Skip to content

Instantly share code, notes, and snippets.

@daattali
Created May 6, 2017 19:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daattali/33b7da34f8451585f9f108a1cb18f6c1 to your computer and use it in GitHub Desktop.
Save daattali/33b7da34f8451585f9f108a1cb18f6c1 to your computer and use it in GitHub Desktop.
Turn selectize input into a tags input
# This can be improved in a few ways easily:
# - make this into a function so you don't need to know all the parameters
# - use CSS to not show the dropdown that keeps popping up to "add" each item
library(shiny)
ui <- fluidPage(
selectizeInput("select", "Select", c(),
multiple = TRUE, options = list(
'create' = TRUE,
'persist' = FALSE)
),
textOutput("out")
)
server <- function(input, output){
output$out <- renderText({
input$select
})
}
shinyApp(ui, server)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment