Switch branches/tags
Nothing to show
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
README.md add more info to readme May 11, 2016
app.R add many readmes and a few more examples May 10, 2016


Toggle a UI element (alternate between show/hide) with a button

Sometimes you want to toggle a section of the UI every time a button is clicked. Since each time a button is clicked, its value is increased by 1, you can use that to toggle an element: place the element inside a conditionalPanel(), and in the condition, check for the value of the button modulo 2 (to check if the button has been pressed an even or odd number of times). This is the most basic toggling behaviour. If you want anything more advanced, you can use the toggle() function from the shinyjs package.