带有递增和递减按钮的闪亮滑块

shiny slider with button for increment and decrement

闪亮的滑块是否有可能有递增和递减按钮,而不是拖动滑块?

也许我的包裹shinyChakraSlider合适。 chakraSliderInput 组合了滑块和数字输入:

这是生成您在此 GIF 上看到的应用程序的代码:

library(shiny)
library(shinyChakraSlider)

ui <- fluidPage(
  br(),
  chakraSliderInput("slider", value = 5, min = 0, max = 10, step = 0.5,
                    width = "50%", size = "lg",
                    numberInputOptions = numberInputOptions(
                      width = "25%",
                      fontSize = "15px", 
                      fontColor = "navyblue",
                      borderColor = "yellow",
                      borderWidth = "medium",
                      focusBorderColor = "navyblue",
                      stepperColor = c("palegreen", "palevioletred")
                    ),
                    trackColor = c("red", "blue"),
                    thumbOptions = thumbOptions(
                      width = "40px",
                      height = "30px",
                      color = "pink",
                      borderColor = "magenta",
                      borderWidth = "2px",
                      icon = "arrows",
                      iconSize = "2em"
                    )
  ),
  br(),
  verbatimTextOutput("value")
)

server <- function(input, output){
  output[["value"]] <- renderPrint({
    input[["slider"]]
  })
}

shinyApp(ui, server)

要安装此包:

devtools::install_github("stla/shinyChakraInput")