ProductPromotion
Logo

R Programming

made by https://0x3d.site

GitHub - daattali/shinyjs: 💡 Easily improve the user experience of your Shiny apps in seconds
💡 Easily improve the user experience of your Shiny apps in seconds - daattali/shinyjs
Visit Site

GitHub - daattali/shinyjs: 💡 Easily improve the user experience of your Shiny apps in seconds

GitHub - daattali/shinyjs: 💡 Easily improve the user experience of your Shiny apps in seconds


{shinyjs} lets you perform common useful JavaScript operations in Shiny apps that will greatly improve your apps without having to know any JavaScript.

Examples include: hiding an element, disabling an input, resetting an input back to its original value, delaying code execution by a few seconds, and many more useful functions for both the end user and the developer. {shinyjs} can also be used to easily call your own custom JavaScript functions from R.

Need Shiny help? I'm available for consulting. If you find {shinyjs} useful, please consider supporting my work! ❤

This package is part of a larger ecosystem of packages with a shared vision: solving common Shiny issues and improving Shiny apps with minimal effort, minimal code changes, and clear documentation. Other packages for your Shiny apps:

Package Description Demo
shinyalert 🗯️ Easily create pretty popup messages (modals) in Shiny 🔗
shinyscreenshot 📷 Capture screenshots of entire pages or parts of pages in Shiny apps 🔗
timevis 📅 Create interactive timeline visualizations in R 🔗
shinycssloaders ⌛ Add loading animations to a Shiny output while it's recalculating 🔗
colourpicker 🎨 A colour picker tool for Shiny and for selecting colours in plots 🔗
shinybrowser 🌐 Find out information about a user's web browser in Shiny apps 🔗
shinydisconnect 🔌 Show a nice message when a Shiny app disconnects or errors 🔗
shinytip 💬 Simple flexible tooltips for Shiny apps WIP
shinymixpanel 🔍 Track user interactions with Mixpanel in Shiny apps or R scripts WIP
shinyforms 📝 Easily create questionnaire-type forms with Shiny WIP

Table of contents

There are no sponsors yet

Become the first sponsor for {shinyjs} and unlock special rewards!

Note: In order to use any {shinyjs} function in a Shiny app, you must first call useShinyjs() anywhere in the app’s UI.

Functions that help you during Shiny app development

Check out the {shinyjs} demo app to see some of these in action, or install {shinyjs} and run shinyjs::runExample() to see more demos.

For most users: To install the stable CRAN version:

install.packages("shinyjs")

For advanced users: To install the latest development version from GitHub:

install.packages("remotes")
remotes::install_github("daattali/shinyjs")

A typical Shiny app has a UI portion and a server portion. Before using most {shinyjs} functions, you need to call useShinyjs() in the app’s UI. It’s best to include it near the top as a convention.

Here is a minimal Shiny app that uses {shinyjs}:

library(shiny)
library(shinyjs)

ui <- fluidPage(
  useShinyjs(),  # Include shinyjs

  actionButton("button", "Click me"),
  textInput("text", "Text")
)

server <- function(input, output) {
  observeEvent(input$button, {
    toggle("text")  # toggle is a shinyjs function
  })
}

shinyApp(ui, server)

This is how most Shiny apps should initialize {shinyjs} - by calling useShinyjs() near the top of the UI.

However, if you use {shinyjs} in any of the following cases:

  • In Shiny dashboards (built using the shinydashboard package)
  • In Shiny apps that use a navbarPage layout
  • In Rmd documents
  • In Shiny apps that manually build the user interface with an HTML file or template (instead of using Shiny’s UI functions)

Then you should see the Including {shinyjs} in different types of apps document.

If your Shiny app doesn’t fall into any of these categories, then the above code sample should be enough to get your started with including {shinyjs} in your app.

See the {shinyjs} example app walk-through document for a step-by-step guide on how to add a variety of {shinyjs} features to a simple app in order to make it more user friendly.

You can also use {shinyjs} to add your own JavaScript functions that can be called from R as if they were regular R functions using extendShinyjs(). This is only suitable for advanced users who are familiar with JavaScript and wish to facilitate the communication between R and JavaScript.

To learn about this feature and see how useful it can be, see the extendShinyjs: Calling your own JavaScript functions from R document.

There are several questions that pop up very frequently in my email or on StackOverflow about “How do I use {shinyjs} to do ___?” Here is a list of a few of these common questions with links to a solution that could be useful. Note that all of these require using extendShinyjs().

I also keep a long list of various Shiny tips & tricks for solving common Shiny problems, many of which make use of {shinyjs}.

This document is only an overview of {shinyjs}. There are more in-depth resources available on the {shinyjs} website.

If you need help with {shinyjs}, free support is available on StackOverflow, RStudio Community, and Twitter.

Due to the large volume of requests I receive, I’m unable to provide free support. If you can’t solve an issue and require paid help, please contact me.

Logo design by Alfredo Hernández.

More Resources
to explore the angular.

mail [email protected] to add your project or resources here 🔥.

Related Articles
to learn about angular.

FAQ's
to learn more about Angular JS.

mail [email protected] to add more queries here 🔍.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory