chakraRangeSlider: Chakra range slider

Description Usage Arguments Value Examples

View source: R/chakraSlider.R

Description

Create a Chakra range slider.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
chakraRangeSlider(
  id,
  label = NULL,
  values,
  min,
  max,
  step = NULL,
  width = NULL,
  size = "md",
  colorScheme = "blue",
  orientation = "horizontal",
  focusThumbOnChange = TRUE,
  isDisabled = FALSE,
  isReadOnly = FALSE,
  isReversed = FALSE,
  trackColor = NULL,
  filledTrackColor = NULL,
  tooltip = TRUE,
  tooltipOptions = sliderTooltipOptions(),
  thumbOptionsLeft = sliderThumbOptions(),
  thumbOptionsRight = sliderThumbOptions(),
  shinyValueOn = "end",
  ...
)

Arguments

id

widget id

label

label (optional)

values

the two initial values

min

minimal value

max

maximal value

step

increment step

width

slider width

size

size, "sm", "md", or "lg"

colorScheme

a Chakra color scheme

orientation

slider orientation, "horizontal" or "vertical"

focusThumbOnChange

whether to focus the thumb on change

isDisabled

whether to disable the slider

isReadOnly

read only mode

isReversed

whether to reverse the slider

trackColor

color of the track

filledTrackColor

color of the filled track

tooltip

whether to set a tooltip to the thumb

tooltipOptions

options of the tooltip, a list created with sliderTooltipOptions

thumbOptionsLeft

list of options for the left thumb, created with sliderThumbOptions

thumbOptionsRight

list of options for the right thumb, created with sliderThumbOptions

shinyValueOn

either "drag" or "end", the moment to get the Shiny value

...

other attributes passed to RangeSlider

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
# Run `chakraExample("RangeSlider")` to see a better example.
library(shiny)
library(shinyChakraUI)

ui <- chakraPage(

  br(),

  chakraComponent(
    "mycomponent",

    chakraRangeSlider(
      "slider",
      label = HTML("<span style='color:red'>Hello range slider!</span>"),
      values = c(2, 8),
      min = 0,
      max = 10,
      width = "50%",
      tooltip = TRUE,
      tooltipOptions = sliderTooltipOptions(placement = "bottom"),
      shinyValueOn = "end"
    )

  )

)

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.