Skip to content

Instantly share code, notes, and snippets.

@daattali
Last active May 5, 2017 23:43
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/4ad82270da4a8d7fa1c58d5cac88e7e7 to your computer and use it in GitHub Desktop.
Save daattali/4ad82270da4a8d7fa1c58d5cac88e7e7 to your computer and use it in GitHub Desktop.
Extremely basic bootstrap tagsinput wrapper in shiny
# http://bootstrap-tagsinput.github.io/bootstrap-tagsinput/examples/
library(shiny)
tagsinput <- function(tag) {
tag$children[[2]] <- tagAppendAttributes(tag$children[[2]],
`data-role` = "tagsinput")
tag
}
ui <- fluidPage(
tags$head(
tags$script(src = "//rawgit.com/bootstrap-tagsinput/bootstrap-tagsinput/master/dist/bootstrap-tagsinput.min.js"),
tags$link(href = "//rawgit.com/bootstrap-tagsinput/bootstrap-tagsinput/master/dist/bootstrap-tagsinput.css", rel="stylesheet")
),
tagsinput(
textInput("text", "Text", "one, two, three")
)
)
server <- function(input,output) {
}
shinyApp(ui,server)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment