Skip to content
GetUrUI

Theme switchers

3 variantsNew
.md

Three appearance controls — a light/dark/system segmented switch with a sliding thumb, an appearance card with live mini previews, and an accent and density picker — that report changes without touching your site.

themedark modelight modeappearanceaccentdensitysegmented controlsettings

Segmented

segmented.tsx

Light, dark and system options with a thumb that slides between them and an icon that turns as it lands; text or icon-only.

$npx shadcn@latest add @geturui/theme-switchers-segmented
.zip
PropTypeDefaultDescription
value / defaultValue"light" | "dark" | "system""system"Controlled or initial choice.
onChange(theme: ThemeChoice) => void—Fires with the new choice.
iconOnlybooleanfalseHide labels for toolbars.
size"sm" | "md""md"Control height.
classNamestring—Extra classes on the root element.

Appearance card

appearance-card.tsx

Theme cards with tiny app windows drawn in each theme's real tokens, a check that pops onto the chosen one and a stepped text-size slider.

$npx shadcn@latest add @geturui/theme-switchers-appearance-card
.zip
PropTypeDefaultDescription
defaultValue{ theme; textSize }dark, 100Initial theme and text size in percent.
onChange(value: AppearanceSettings) => void—Fires with every change.
classNamestring—Extra classes on the root element.

Accent and density

accent-density.tsx

Accent swatches and a density control beside a live preview whose rows re-space with a layout spring and repaint in the chosen accent.

$npx shadcn@latest add @geturui/theme-switchers-accent-density
.zip
PropTypeDefaultDescription
defaultValue{ accent; density }volt, defaultInitial accent and density.
onChange(value: AccentDensityValue) => void—Fires with every change; only the preview updates.
classNamestring—Extra classes on the root element.

Install the whole set

Installs every theme switchers variant at once. Each section above has its own command for a single variant.

$npx shadcn@latest add @geturui/theme-switchers
Download source (.zip)

Accessibility

  • Every control is a radiogroup with one tab stop; arrow keys move and select, Home and End jump to the ends.
  • The text size slider is a native range input with a spoken percentage.
  • Choices only change local state and fire onChange, so nothing on the host page shifts unexpectedly; motion reduces to fades.

Related