Skip to contents

Drop-in button group for switching the glass preset. Each button sets the preset on the client immediately (window.shinyglass.setPreset) and also has a 'shiny' input id so observe_glass_theme_toggle() can keep the server in sync (important on hosts that rewrite custom messages).

Usage

glass_theme_toggle(
  inputId = "glass_toggle",
  selected = c("auto", "light", "dark"),
  labels = c(light = "Light", dark = "Dark", auto = "Auto (OS)"),
  class = "glass-theme-toggle"
)

Arguments

inputId

Base id. Buttons are {inputId}_light, {inputId}_dark, and {inputId}_auto.

selected

Initially highlighted mode ("light", "dark", or "auto"). Cosmetic only; the page theme still comes from glass_theme().

labels

Named character vector for button labels. Names must be light, dark, and/or auto.

class

Extra CSS classes for the wrapper.

Value

An htmltools::tag() button group.