# NOT RUN {
## Only run examples in interactive R sessions
if (interactive()) {
library(shiny)
library(shinyWidgets)
ui <- fluidPage(
dropdownButton(
label = "Controls",
icon = icon("sliders"),
status = "primary",
circle = FALSE,
sliderInput(
inputId = "n",
label = "Number of observations",
min = 10, max = 100, value = 30
),
prettyToggle(
inputId = "na",
label_on = "NAs keeped",
label_off = "NAs removed",
icon_on = icon("check"),
icon_off = icon("remove")
)
),
tags$div(style = "height: 140px;"), # spacing
verbatimTextOutput(outputId = "out")
)
server <- function(input, output, session) {
output$out <- renderPrint({
cat(
" # n\n", input$n, "\n",
"# na\n", input$na
)
})
}
shinyApp(ui, server)
}
# }
Run the code above in your browser using DataLab