materialSwitch: Material Design Switch Input Control

Description Usage Arguments Value Examples

View source: R/input-materialswitch.R

Description

Create buttons grouped that act like radio buttons.

Usage

1
2
materialSwitch(inputId, label = NULL, value = FALSE, status = "default",
  right = FALSE, width = NULL)

Arguments

inputId

The input slot that will be used to access the value.

label

Input label.

value

TRUE or FALSE.

status

Color of the switch

right

Should the the label be on the right ? default to FALSE

width

Width of the container

Value

A switch control that can be added to a UI definition.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
materialSwitch(inputId = "somevalue", label = "")
## Not run: 
## Only run examples in interactive R sessions
if (interactive()) {

ui <- fluidPage(
  materialSwitch(inputId = "somevalue", label = ""),
  verbatimTextOutput("value")
)
server <- function(input, output) {
  output$value <- renderText({ input$somevalue })
}
shinyApp(ui, server)
}

## End(Not run)

aghozlane/shinyWidgets documentation built on May 5, 2019, 8:01 p.m.