Skip to contents

Wraps shiny::fluidPage() with glass_theme() and, by default, the Light / Dark / Auto toggle, intensity slider, and accent wells. Pair with observe_glass() in the server function.

Usage

glass_page(
  ...,
  title = NULL,
  preset = "auto",
  intensity = 0.5,
  persist = TRUE,
  scene = "tahoe",
  wallpaper = NULL,
  plot_surface = "clear",
  flatten = FALSE,
  refraction = TRUE,
  morph = TRUE,
  press = TRUE,
  scroll_edge = TRUE,
  minimize_tabs = TRUE,
  icon_style = c("clear", "color", "all"),
  floating_sidebar = FALSE,
  controls = TRUE,
  theme = NULL
)

Arguments

...

UI elements passed to shiny::fluidPage().

title

Optional page title (shiny::titlePanel()).

preset, intensity, persist, scene, wallpaper, plot_surface, flatten, refraction, morph, press, scroll_edge, minimize_tabs, icon_style, floating_sidebar

Forwarded to glass_theme(). preset is "light", "dark", or "auto" (default "auto"). intensity is numeric from 0 (Ultra Clear) to 1 (Tinted), default 0.5. Persistence defaults to TRUE here. floating_sidebar stays off unless you opt in.

controls

TRUE for the default control row (toggle, intensity, accent), FALSE for none, or a character vector subset of "toggle", "intensity", "accent".

theme

Optional pre-built glass_theme() object. When NULL, one is created from the arguments above.

Value

A Shiny UI tag list suitable as shinyApp(ui = ...).

Examples

if (interactive()) {
  library(shiny)
  library(shinyglass)

  ui <- glass_page(
    title = "Hello, glass",
    plotOutput("plot")
  )
  server <- function(input, output, session) {
    observe_glass(input, session)
    output$plot <- renderPlot(plot(1:10), bg = "transparent")
  }
  shinyApp(ui, server)
}