shinyWidgets
包中的pickerInput
有一个占位符标题Nothing selected
。
例如,如何用Pick a choice
替换它?我更喜欢使用 css 或pickerInput
选项的解决方案,如果可能的话,避免shinyjs
.
library(shiny)
library(shinyWidgets)
ui <- fluidPage(
tags$head(
tags$style(HTML("
"))
),
pickerInput(
inputId = "mtcInputIndicateur",
label = "Select values",
choices = paste("choice", 1:10),
options = list(`live-search` = TRUE),
multiple = TRUE
)
)
server <- function(input, output){
}
shinyApp(ui, server)
任何帮助将不胜感激。
刚找到答案,使用options
中的参数title
.
library(shiny)
library(shinyWidgets)
ui <- fluidPage(
pickerInput(
inputId = "mtcInputIndicateur",
label = "Select values",
choices = paste("choice", 1:10),
options = list(`live-search` = TRUE, title = "Pick a choice"),
multiple = TRUE
)
)
server <- function(input, output){
}
shinyApp(ui, server)