Last active
April 13, 2021 00:31
-
-
Save pvictor/aae0413ca56c5947f0d816e5aff2cfeb to your computer and use it in GitHub Desktop.
Inline shinyWidgets::pickerInput
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(shiny) | |
library(shinyWidgets) | |
library(htmltools) | |
ui <- fluidPage( | |
tags$h2("Inline pickers input"), | |
tags$br(), | |
# CSS styles | |
tags$style( | |
".btn-inline { | |
background: #FFF; | |
border-bottom: solid 1px steelblue; | |
border-radius: 0; | |
}", | |
".btn-inline .filter-option-inner-inner { font-size: large; }" | |
), | |
# Inline pickers | |
tags$div( | |
style = "text-align: center;font-size: large;", | |
tags$span("Filter by"), | |
tagAppendAttributes( | |
pickerInput( | |
inputId = "optionA", | |
label = NULL, | |
width = "fit", | |
choices = paste("choice A -", 1:10), | |
options = pickerOptions( | |
style = "btn-inline" | |
) | |
), | |
class = "shiny-input-container-inline", | |
style = "display: inline-block;" | |
), | |
tags$span( | |
"and by" | |
), | |
tagAppendAttributes( | |
pickerInput( | |
inputId = "optionB", | |
label = NULL, | |
width = "fit", | |
choices = paste("choice B -", 1:10), | |
options = pickerOptions( | |
style = "btn-inline" | |
) | |
), | |
class = "shiny-input-container-inline", | |
style = "display: inline-block;" | |
) | |
) | |
) | |
server <- function(input, output, session) { | |
} | |
shinyApp(ui, server) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Which renders: