I saw a shiny
app, here which uses a resizable selectInput
but couldn't figure out how it's been developed. I wonder if anybody has any idea?
Asked
Active
Viewed 115 times
1

Abbas
- 807
- 7
- 14
-
They used a very simple CSS rule: `textarea, select {resize: vertical;overflow: auto;}` – lz100 Sep 15 '22 at 20:49
-
Can you please explain how I can use it? I am a beginner. – Abbas Sep 15 '22 at 21:58
-
https://developer.mozilla.org/en-US/docs/Web/CSS/resize – lz100 Sep 15 '22 at 22:50
1 Answers
2
library(shiny)
css <- "select {resize: vertical; overflow: auto;}"
shinyApp(
ui = fluidPage(
tags$head(tags$style(HTML(css))),
selectInput(
"variable", "Variable:", names(mtcars), selectize = FALSE, size = 5L
)
),
server = function(input, output) {
}
)

Stéphane Laurent
- 75,186
- 15
- 119
- 225