I want to change the size of the selectInput() widget in shiny. I know it is based on selectize.js, so I have tried modifying every single attribute on this page (https://github.com/selectize/selectize.js/blob/master/dist/css/selectize.css)
and can't figure out which one controls the height. But I don't know CSS or javascript. Any suggestions?
Minimal example:
library(shiny)
ui <- fluidPage(
fluidRow(
actionButton('play_but', 'Play', style='height: 20px; font-size: 10px; padding: 1px 1px;'),
actionButton('pause_but', 'Pause', style='height: 20px; font-size: 10px; padding: 1px 1px;'),
selectInput("speed", label=NULL, choices = list("1" = 1, "2" = 2), selected = 1),
tags$head(tags$style(HTML(".selectize-input {max-height: 5px !important; font-size: 10px; padding: 1px 1px; box-sizing: content-box;}"))),
tags$head(tags$style(HTML(".selectize-input input {line-height: 10px;}"))),
tags$head(tags$style(HTML(".selectize-dropdown-content {font-size: 10px; }")))
)
)
shinyApp(ui, server)
produces:
try this and have fun:
library(shiny)
ui <- fluidPage(
fluidRow(
selectInput("speed", label=NULL, choices = list("1" = 1, "2" = 2), selected = 1),
tags$head(tags$style(HTML(".selectize-input {height: 100px; width: 500px; font-size: 100px;}")))
)
)
server <- function(input, output){}
shinyApp(ui, 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