Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Showcase - new example for HTMLselect #42

Open
jan-smo opened this issue Jul 27, 2022 · 0 comments
Open

Showcase - new example for HTMLselect #42

jan-smo opened this issue Jul 27, 2022 · 0 comments

Comments

@jan-smo
Copy link

jan-smo commented Jul 27, 2022

[Proposal]
to add to showcase / doc

To give a different description of the selection (what the user sees) but different (shorter) in the server part you have to use a list with value and label pairs.
Example:

library(appsilon.blueprint)
library(shiny)

options <- list(
  list(value = "a", label = "Apples"),
  list(value = "b", label = "Bananas"),
  list(value = "c", label = "Cherries")
)

shinyApp(
  ui = tagList(
    HTMLSelect.shinyInput(
      inputId = "choice",
      value = "b",
      options = options
    ),
    textOutput("text")
  ),

  server = function(input, output) {​
    output$text <- renderText(deparse(input$choice))
  }
)

Note that HTMLselect component in Blueprint.js doesn't support item grouping,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant