shinyjs demo

Show/hide advanced info

Timestamp: Sat Mar 29 08:03:54 2025 Update



shinyjs usage in this app

  • Selecting 'Bigger text' uses shinyjs::addClass() to add a CSS class to the webpage that enlarges the font
  • Typing text inside the 'Name' field uses shinyjs::toggleState() to enable the submit button, and similary to disable the button when there is no input
  • Clicking 'Show/hide advanced info' uses shinyjs::onclick() and shinyjs::toggle() to toggle between showing and hiding the advanced info section when the link is clicked
  • Clicking 'Update' uses shinyjs::onclick() and shinyjs::html() to update the HTML in the timestamp when the link is clicked
  • Clicking 'Submit' uses shinyjs::alert() to show a message to the user

These are just a subset of the functions available in shinyjs.

This app is available at https://daattali.com/shiny/shinyjs-basic/ and the source code is on GitHub

Visit the shinyjs website to learn more
More apps by Dean❤ Support