chooseSliderSkin: Theme selector for 'sliderInput'

Description Usage Arguments Note See Also Examples

View source: R/chooseSliderSkin.R

Description

Customize the appearance of the original shiny's sliderInput

Usage

1
2
3
4
5
chooseSliderSkin(
  skin = c("Shiny", "Flat", "Big", "Modern", "Sharp", "Round", "Square", "Nice",
    "Simple", "HTML5"),
  color = NULL
)

Arguments

skin

The skin to apply. Choose among 5 different flavors, namely 'Shiny', 'Flat', 'Modern', 'Nice', 'Simple', 'HTML5', 'Round' and 'Square'.

color

A color to apply to all sliders. Works with following skins: 'Shiny', 'Flat', 'Modern', 'HTML5'. For 'Flat' a CSS filter is applied, desired color maybe a little offset.

Note

It is not currently possible to apply multiple themes at the same time.

See Also

See setSliderColor to update the color of your sliderInput.

Examples

 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
50
51
52
53
54
55
56
if (interactive()) {

library(shiny)
library(shinyWidgets)

# With Modern design

ui <- fluidPage(
  chooseSliderSkin("Modern"),
  sliderInput("obs", "Customized single slider:",
              min = 0, max = 100, value = 50
  ),
  sliderInput("obs2", "Customized range slider:",
              min = 0, max = 100, value = c(40, 80)
  ),
  plotOutput("distPlot")
)

server <- function(input, output) {

  output$distPlot <- renderPlot({
    hist(rnorm(input$obs))
  })

}

shinyApp(ui, server)



# Use Flat design & a custom color

ui <- fluidPage(
  chooseSliderSkin("Flat", color = "#112446"),
  sliderInput("obs", "Customized single slider:",
              min = 0, max = 100, value = 50
  ),
  sliderInput("obs2", "Customized range slider:",
              min = 0, max = 100, value = c(40, 80)
  ),
  sliderInput("obs3", "An other slider:",
              min = 0, max = 100, value = 50
  ),
  plotOutput("distPlot")
)

server <- function(input, output) {

  output$distPlot <- renderPlot({
    hist(rnorm(input$obs))
  })
}

shinyApp(ui, server)

}

Example output



shinyWidgets documentation built on Sept. 17, 2021, 5:06 p.m.