Skip to contents

Build a custom shadshiny theme by overriding design tokens. Only the tokens you supply are emitted; everything else inherits the base theme, so a one-liner like shad_theme(primary = "#7c3aed") is a complete brand theme. Pass the result to page_shad(), shad_theme_scope(), or update_shad_theme().

Usage

shad_theme(
  primary = NULL,
  primary_foreground = NULL,
  background = NULL,
  foreground = NULL,
  card = NULL,
  card_foreground = NULL,
  muted = NULL,
  muted_foreground = NULL,
  accent = NULL,
  accent_foreground = NULL,
  destructive = NULL,
  border = NULL,
  input = NULL,
  ring = NULL,
  radius = NULL,
  font_sans = NULL,
  font_mono = NULL,
  chart = NULL,
  dark = NULL,
  ...
)

Arguments

primary, primary_foreground, background, foreground, card, card_foreground, muted, muted_foreground, accent, accent_foreground, destructive, border, input, ring

Color tokens. Accept any CSS color string ("#7c3aed", "oklch(...)") or an R color name.

radius

Base radius (e.g. "0.5rem").

font_sans, font_mono

CSS font-family strings.

chart

Character vector of up to 6 chart series colors.

dark

Optional dark-mode overrides, applied under .dark. Either a second shad_theme() or a named list of the same token arguments, which is passed to shad_theme() for you. Tokens you omit keep their light value.

...

Any additional raw token: sidebar = ... maps to --shad-sidebar, sidebar_primary = ... to --shad-sidebar-primary, etc.

Value

A shad_theme object.

Examples

shad_theme(primary = "#7c3aed", radius = "0.75rem")
#> $tokens
#> $tokens$primary
#> [1] "#7c3aed"
#> 
#> $tokens$radius
#> [1] "0.75rem"
#> 
#> 
#> $dark
#> NULL
#> 
#> attr(,"class")
#> [1] "shad_theme"