简体   繁体   中英

picketInput change placeholder R Shiny Widgets

pickerInput from shinyWidgets package has a placeholder title Nothing selected .

How is it possible to replace it with Pick a choice for example ? I would prefer a solution that uses css or the options of pickerInput , if possible avoid 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)

Any help would be greatly appreciated.

Just found the answer, use the parameter title in options .

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)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM