I am trying to increase the length of the dropdown list when using selectizeInput in Shiny.
I know I can set the max number of items shown by: options = list(maxOptions = n)
but how could I define a minimum number of options?
As said in the comments, there is no minimum number of options setting, at least none that I know of. However, since you're trying to increase the length of the dropdown, you can just do that with CSS.
Suppose this is your dropdown:
selectizeInput("select", "Select multiple options",
choices = LETTERS, multiple = T
),
Just add:
tags$style(type='text/css',
".selectize-dropdown-content {
max-height: 600px; ## CHANGE THIS
}"
)
And you get:
As a minimal example, try this:
library(shiny)
ui <- fluidPage(
selectizeInput("select", "Select multiple options",
choices = LETTERS, multiple = T
),
tags$style(type='text/css',
".selectize-dropdown-content {
max-height: 600px;
}"
)
)
server <- function(input, output){}
shinyApp(ui=ui, server=server)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With