This is a simple question: I'm having a hard time finding a documentation of what can go into the choicesOpt
argument of pickerInput
. I've tried Google, Stackoverflow and most of the doc-sites I know and tried looking in the source of the package yet haven't found anything. Could someone point me in the right direction?
Asked
Active
Viewed 1,018 times
1

sedsiv
- 531
- 1
- 3
- 15
2 Answers
2
choicesOpt
argument is useful to apply formatting to the inputs of pickerInput
.
For example to give background to the options of pickerInput
you can do :
library(shiny)
cols <- c('blue', 'green', 'red', 'yellow')
ui <- fluidPage(
pickerInput("col", "Colour", choices = cols,
choicesOpt = list(style = sprintf('background:%s;', cols)))
)
server <- function(input, output){}
shinyApp(ui, server)

Ronak Shah
- 377,200
- 20
- 156
- 213
2
Select picker Input Control, i.e. the pickerInput
is built on top of bootsrap-select
, documentation for all the options is here

Pork Chop
- 28,528
- 5
- 63
- 77
-
1In the options section there are options listed that can either go into the `options` argument (like `hideDisabled`) or into the `choicesOpt` argument (like `style`). How do I know where to put which? – sedsiv Apr 22 '21 at 14:28