View source: R/glass_select_theme.R
| glass_select_theme | R Documentation |
All color arguments accept any valid CSS color string (hex, rgb(),
rgba(), named colors). Unset fields inherit from the mode base preset.
glass_select_theme(
mode = c("dark", "light"),
bg_color = NULL,
border_color = NULL,
text_color = NULL,
accent_color = NULL,
focus_ring = NULL,
label_color = NULL
)
mode |
Base preset. One of |
bg_color |
Background of the trigger button and dropdown panel. |
border_color |
Border color of the trigger and dropdown. |
text_color |
Main text color for options and the trigger label. |
accent_color |
Highlight color for checkmarks, badges, and selected states. |
focus_ring |
Keyboard focus indicator color. Choose a color with at least 3:1 contrast against the trigger and dropdown surfaces. |
label_color |
Widget label color. Defaults to |
A named list of class "glass_select_theme" for passing to the
theme argument of glassMultiSelect() or glassSelect().
# Teal accent on a dark base
teal_theme <- glass_select_theme(
mode = "dark",
accent_color = "#2dd4bf",
bg_color = "rgba(9, 20, 42, 0.97)"
)
# Light mode with a custom purple accent
purple_light <- glass_select_theme(
mode = "light",
accent_color = "#7c3aed",
border_color = "rgba(124, 58, 237, 0.35)"
)
if (interactive()) {
library(shiny)
choices <- c(Revenue = "rev", Orders = "ord", Returns = "ret")
ui <- fluidPage(
useGlassTabs(),
glassMultiSelect("metric", choices, theme = teal_theme),
glassSelect("region", c(All = "all", North = "n", South = "s"),
theme = purple_light)
)
server <- function(input, output, session) {}
shinyApp(ui, server)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.