Description Usage Arguments Details See Also Examples
This creates a slider input using Semantic UI. Slider is already initialized and
available under input[[input_id]]
. Use Range for range of values.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
input_id |
Input name. Reactive value is available under |
value |
The initial value to be selected for the sldier (lower value if using range). |
min |
The minimum value allowed to be selected for the slider. |
max |
The maximum value allowed to be selected for the slider. |
step |
The interval between each selectable value of the slider. |
class |
UI class of the slider. Can include |
custom_ticks |
A vector of custom labels to be added to the slider. Will ignore |
inputId |
Input name. |
label |
Display label for the control, or NULL for no label. |
width |
character with width of slider. |
ticks |
|
... |
additional arguments |
value2 |
The initial upper value of the slider. |
Use update_slider
to update the slider/range within the shiny session.
update_slider for input updates, https://fomantic-ui.com/modules/slider.html for preset classes.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | if (interactive()) {
# Slider example
library(shiny)
library(shiny.semantic)
ui <- shinyUI(
semanticPage(
title = "Slider example",
tags$br(),
slider_input("slider", 10, 0, 20, class = "labeled ticked"),
p("Selected value:"),
textOutput("slider")
)
)
server <- shinyServer(function(input, output, session) {
output$slider <- renderText(input$slider)
})
shinyApp(ui = ui, server = server)
# Custom ticks slider
ui <- shinyUI(
semanticPage(
title = "Slider example",
tags$br(),
slider_input("slider_ticks", "F", custom_ticks = LETTERS, class = "labeled ticked"),
p("Selected value:"),
textOutput("slider_ticks")
)
)
server <- shinyServer(function(input, output, session) {
output$slider_ticks <- renderText(input$slider_ticks)
})
shinyApp(ui = ui, server = server)
# Range example
ui <- shinyUI(
semanticPage(
title = "Range example",
tags$br(),
range_input("range", 10, 15, 0, 20),
p("Selected values:"),
textOutput("range")
)
)
server <- shinyServer(function(input, output, session) {
output$range <- renderText(paste(input$range, collapse = " - "))
})
shinyApp(ui = ui, server = server)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.