Skip to contents

Drop-in shiny::selectInput() that applies window.shinyglass.setScene() immediately. Pair with observe_glass_scene() so the server stays in sync.

Usage

glass_scene_input(
  inputId = "glass_scene",
  label = "Wallpaper scene",
  selected = "default",
  choices = glass_scenes(),
  width = NULL
)

Arguments

inputId

The input slot that will be used to access the value.

label

Display label (or NULL for none).

selected

Initially selected scene id.

choices

Named character vector. Defaults to glass_scenes().

width

The width of the input (e.g. "100%").

Value

A shiny::selectInput() tag marked for client bindings.

Examples

glass_scene_input(selected = "harbor")
#> <div class="form-group shiny-input-container">
#>   <label class="control-label" id="glass_scene-label" for="glass_scene">Wallpaper scene</label>
#>   <div>
#>     <select id="glass_scene" class="shiny-input-select glass-scene-input" data-glass-scene-input="glass_scene"><option value="default">Default orbs</option>
#> <option value="tahoe">Lake Tahoe mist</option>
#> <option value="dusk">Warm dusk</option>
#> <option value="mesh">Soft RGB mesh</option>
#> <option value="aurora">Aurora veil</option>
#> <option value="harbor" selected>Harbor morning</option>
#> <option value="grove">Orchard grove</option></select>
#>     <script type="application/json" data-for="glass_scene" data-nonempty="">{"plugins":["selectize-plugin-a11y"]}</script>
#>   </div>
#> </div>