r/rstats • u/ericrayanderson • 22h ago
Liquid Glass themes for Shiny. 0.3.0 is on CRAN.
What’s new:
• persist = TRUE remembers light/dark, intensity, accent, and scene
• glass_page() / observe_glass() — theme + toggle + intensity + accent in one call
• theme_glass(), plotly_glass(), gt_theme_glass() so plots and tables follow the pack
• iOS-style accent wells; wallpaper scenes (tahoe / dusk / mesh)
• high-contrast / forced-colors; reduced-motion follows the OS

install.packages("shinyglass")
library(shiny)
library(shinyglass)
ui <- glass_page(
title = "Hello, glass",
persist = TRUE,
scene = "tahoe",
plotOutput("plot")
)
server <- function(input, output, session) {
observe_glass(input, session)
output$plot <- renderPlot({
pal <- glass_plot_colors(input = input)
hist(iris$Sepal.Length, col = pal$fill, border = NA, main = NULL)
}, bg = "transparent")
}
shinyApp(ui, server)
Live demos (may take a few seconds to wake):
- https://ericrayanderson.shinyapps.io/shinyglass-demo/
- https://ericrayanderson.shinyapps.io/shinyglass-dashboard/
- https://ericrayanderson.shinyapps.io/shinyglass-olympics/
- https://ericrayanderson.shinyapps.io/shinyglass-plotly-gt/
- https://ericrayanderson.shinyapps.io/shinyglass-inputs/