Skip to content

Instantly share code, notes, and snippets.

@pvictor
Last active May 30, 2022 18:07
Show Gist options
  • Save pvictor/ee154cc600e82f3ed2ce0a333bc7d015 to your computer and use it in GitHub Desktop.
Save pvictor/ee154cc600e82f3ed2ce0a333bc7d015 to your computer and use it in GitHub Desktop.
Add a remove button to each item of a selectize input
library(shiny)
ui <- fluidPage(
selectizeInput(
inputId = "select",
label = "Select",
choices = NULL,
multiple = TRUE,
options = list(
plugins = list("remove_button"),
create = TRUE,
persist = TRUE # keep created choices in dropdown
)
),
verbatimTextOutput("out")
)
server <- function(input, output){
output$out <- renderPrint({
input$select
})
}
shinyApp(ui, server)
@mattapel
Copy link

So great, thank you very much !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment