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.45,
  persist = TRUE,
  scene = "tahoe",
  wallpaper = NULL,
  plot_surface = "clear",
  flatten = 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

Forwarded to glass_theme(). Persistence defaults to TRUE here.

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