Skip to content

Showcase - new example for HTMLselect #42

Open
@jan-smo

Description

@jan-smo

[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,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions