Skip to contents

Adds a switch for boolean values

Usage

IconSwitch.shinyInput(inputId, ..., value = defaultValue)

Arguments

inputId

The input id

...

args to pass to the element including the icon for the switch

value

The value of the input

Examples

library(shiny.quartz)
library(shiny.mui)
library(shiny)


if (interactive()) {
    shinyApp(
        ui = div(
            IconSwitch.shinyInput("text", TableViewIcon(), value = T),
            textOutput("textValue")
        ),
        server = function(input, output) {
            output$textValue <- renderText({
                sprintf("Value: %s", input$text)
            })
        }
    )
}