% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/glass-theme.R
\name{glass_theme}
\alias{glass_theme}
\title{Liquid Glass theme for 'shiny'}
\usage{
glass_theme(
  preset = c("light", "dark", "auto"),
  primary = "#007AFF",
  blur = 36,
  saturation = 200,
  radius = "1.5rem",
  material = c("regular", "clear"),
  intensity = 0.45,
  tint = TRUE,
  specular = TRUE,
  nav_morph = TRUE,
  ...
)
}
\arguments{
\item{preset}{\code{"light"}, \code{"dark"}, or \code{"auto"}. \code{"auto"} follows
\code{prefers-color-scheme} and updates when the OS theme changes.}

\item{primary}{Accent color for buttons, links, and focus rings.
Defaults to system blue (\verb{#007AFF}).}

\item{blur}{Backdrop blur radius in pixels. Default \code{36} matches the
iOS 27 diffusion-first material.}

\item{saturation}{Backdrop saturation percentage.}

\item{radius}{Default border radius for glass surfaces (CSS length).
Prefer larger concentric radii (default \verb{1.5rem}).}

\item{material}{\code{"regular"} (adaptive, most UI) or \code{"clear"} (more
transparent; best over media-rich content with bold labels).}

\item{intensity}{Liquid Glass intensity from \code{0} (Ultra Clear) to \code{1}
(Tinted), matching iOS 27 Appearance -> Liquid Glass. Default \code{0.45}.
Use \code{\link[=glass_intensity_slider]{glass_intensity_slider()}} for a live control.}

\item{tint}{Content-aware ambient tint from plots/images (JS).}

\item{specular}{Pointer-driven specular highlight on glass surfaces (JS).}

\item{nav_morph}{Compact navbar on scroll down; expand on scroll up (JS).}

\item{...}{Additional arguments forwarded to \code{\link[bslib:bs_theme]{bslib::bs_theme()}}.}
}
\value{
A \code{\link[bslib:bs_theme]{bslib::bs_theme()}} object suitable for 'shiny' page functions.
}
\description{
Create a \code{\link[bslib:bs_theme]{bslib::bs_theme()}} styled with a Liquid Glass look: translucent
surfaces, backdrop blur, soft depth, and system typography. Pass the result
to \verb{theme =} on \code{fluidPage()}, \code{navbarPage()}, \code{bslib::page_sidebar()}, or
any other page function that accepts a bslib theme.
}
\details{
Light and dark surface tokens are compiled into dual CSS custom-property
packs. Switching \code{preset} at runtime (via \code{\link[=update_glass_theme]{update_glass_theme()}} or
\code{preset = "auto"}) updates \code{document.documentElement.dataset.glassPreset}
without recompiling Sass or reloading the page. Accent color can also be
updated live with \code{\link[=update_glass_theme]{update_glass_theme()}} \verb{primary=} (CSS variables).
}
\examples{
theme <- glass_theme()
dark <- glass_theme(preset = "dark", primary = "#BF5AF2")
auto <- glass_theme(preset = "auto", tint = FALSE)
clear <- glass_theme(material = "clear")

if (interactive()) {
  library(shiny)

  ui <- fluidPage(
    theme = glass_theme(preset = "auto"),
    titlePanel("Liquid Glass"),
    glass_theme_toggle(),
    selectInput("color", "Color", c("Blue", "Purple", "Orange")),
    plotOutput("plot")
  )

  server <- function(input, output, session) {
    # Client onclick already switches; keep session in sync:
    observe_glass_theme_toggle(input, session)
  }

  shinyApp(ui, server)
}

}
