Learn R Programming

shinySelect (version 1.3.0)

HTMLchoices: Choices with HTML

Description

Create an object for choices resorting to HTML.

Usage

HTMLchoices(labels, values)

Value

An object (the values object with some attributes) to be passed on to the choices argument of the

selectControlInput function.

Arguments

labels

the labels of the select control, can be HTML elements created with the HTML function or shiny.tag objects such as tags$span(style = "color:lime;", "label")

values

the values associated to the labels, they must be character strings, given in a vector or in a list

See Also

HTMLgroupedChoices for choices with groups.

Examples

Run this code
library(shinySelect)
library(fontawesome)
library(shiny)
food <- HTMLchoices(
  labels = list(
    tags$span(fa_i("hamburger"), "Hamburger"),
    tags$span(fa_i("pizza-slice"), "Pizza"),
    tags$span(fa_i("fish"), "Fish")
  ),
  values = list("hamburger", "pizza", "fish")
)

Run the code above in your browser using DataLab