chakraSlider: Chakra slider

Description Usage Arguments Value Examples

View source: R/chakraSlider.R

Description

Create a Chakra 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
25
chakraSlider(
  id,
  label = NULL,
  value,
  min,
  max,
  step = NULL,
  width = NULL,
  size = "md",
  colorScheme = "blue",
  orientation = "horizontal",
  focusThumbOnChange = TRUE,
  isDisabled = FALSE,
  isReadOnly = FALSE,
  isReversed = FALSE,
  trackColor = NULL,
  filledTrackColor = NULL,
  mark = FALSE,
  markOptions = sliderMarkOptions(),
  tooltip = TRUE,
  tooltipOptions = sliderTooltipOptions(),
  thumbOptions = sliderThumbOptions(),
  shinyValueOn = "end",
  ...
)

Arguments

id

widget id

label

label (optional)

value

initial value

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

mark

whether to set a mark to the thumb (I personally prefer the tooltip)

markOptions

options of the mark, a list created with sliderMarkOptions

tooltip

whether to set a tooltip to the thumb

tooltipOptions

options of the tooltip, a list created with sliderTooltipOptions

thumbOptions

list of options for the thumb created with sliderThumbOptions

shinyValueOn

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

...

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

ui <- chakraPage(

  br(),

  chakraComponent(
    "mycomponent",

    chakraSlider(
      "slider",
      label = HTML("<span style='color:red'>Hello slider!</span>"),
      value = 5,
      min = 0,
      max = 10,
      width = "50%",
      tooltip = TRUE,
      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.