Learn R Programming

shinyBS (version 0.20)

bsNavToggleLink: Twitter Bootstrap Navbar Toggle Link

Description

A Navbar link that works like a checkbox input, with an on and off state.

Usage

bsNavToggleLink(inputId, label, value = FALSE)
updateToggleLink(session, inputId, label = NULL, value = NULL)

Arguments

session
The session object passed to function given to shinyServer
inputId
Input variable to assign the control's value to
label
The label that will appear on the object
value
The value to set for the input object logical

Details

The toggle link is meant as an alternative to checkboxes in a navbar. It will toggle between TRUE and FALSE when clicked.

References

http://getbootstrap.com/2.3.2/components.html{Navbars for Twitter Bootstrap 2.3.2}

Examples

Run this code
## In ui.R
  ## Add a toggleLink to a navbar
  bsNavToggleLink(inputId="tl1", label="Log Scale", value = FALSE)
  
  ## In server.R
  ## Change the value of the created toggleLink to TRUE
  updateToggleLink(session, inputId="tl1", value = TRUE)

Run the code above in your browser using DataLab