HTMLchoices: Choices with HTML

View source: R/selectControl.R

HTMLchoicesR Documentation

Choices with HTML

Description

Create an object for choices resorting to HTML.

Usage

HTMLchoices(labels, values)

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

Value

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

See Also

HTMLgroupedChoices for choices with groups.

Examples

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")
)

shinySelect documentation built on Nov. 18, 2022, 5:10 p.m.