chakraCombinedSlider: Combined slider and number input

Description Usage Arguments Value Examples

View source: R/chakraCombinedSlider.R

Description

A widget combining a slider and a number input.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
chakraCombinedSlider(
  id,
  value,
  min,
  max,
  step = NULL,
  maxWidth = "400px",
  numericInputOptions = numberInputOptions(),
  spacing = "2rem",
  keepWithinRange = TRUE,
  clampValueOnBlur = TRUE,
  focusThumbOnChange = FALSE,
  trackColor = NULL,
  filledTrackColor = NULL,
  tooltip = TRUE,
  tooltipOptions = sliderTooltipOptions(),
  thumbOptions = sliderThumbOptions(),
  ...
)

Arguments

id

widget id

value

initial value

min

minimal value

max

maximal value

step

increment step

maxWidth

slider width

numericInputOptions

list of options for the number input created with numberInputOptions

spacing

the space between the number input and the slider

keepWithinRange

whether to forbid the value to exceed the max or go lower than min

clampValueOnBlur

similar to keepWithinRange

focusThumbOnChange

whether to focus the thumb on change

trackColor

color of the slider track

filledTrackColor

color of the filled slider track

tooltip

whether to set a tooltip to the thumb, to show the value

tooltipOptions

options of the tooltip, a list created with sliderTooltipOptions

thumbOptions

list of options for the thumb created with sliderThumbOptions

...

other attributes passed to Slider

Value

A widget to use in chakraComponent.

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
library(shiny)
library(shinyChakraUI)

ui <- chakraPage(

  br(), br(),

  chakraComponent(
    "mycomponent",

    chakraCombinedSlider(
      "slider",
      value = 5,
      min = 0,
      max = 10,
      step = 0.5,
      maxWidth = "300px",
      tooltip = TRUE,
      trackColor = "green.300",
      thumbOptions = sliderThumbOptions(
        width = 20, height = 20,
        borderColor = "firebrick", borderWidth = "3px"
      )
    )

  )

)

server <- function(input, output, session){

  observe({
    print(input[["slider"]])
  })

}

if(interactive()){
  shinyApp(ui, server)
}

shinyChakraUI documentation built on Jan. 5, 2022, 5:08 p.m.