Primitive
CLI registryAdaptive Theme Switch
A light/dark switch that retunes muted type so vital copy stays readable when a custom light palette goes dark.
Preview → install → use
Preview
npx shadcn@latest add @atroui/theme-adaptPalettes
Light
2.7:1 fail
Studio notes
Cone 6 this Thursday
Hold at peak twenty minutes. The glaze notes sit in muted type. Lose those and the firing is guesswork.
Open scheduleNaive dark
1.6:1 fail
Studio notes
Cone 6 this Thursday
Hold at peak twenty minutes. The glaze notes sit in muted type. Lose those and the firing is guesswork.
Open scheduleAdapt
7.7:1 AA
Studio notes
Cone 6 this Thursday
Hold at peak twenty minutes. The glaze notes sit in muted type. Lose those and the firing is guesswork.
Open scheduleSource lands in your repo. Setup: Installation · Registry catalog.
Usage
API reference
| Prop | Type | Default | Description |
|---|---|---|---|
| className | string | - | Extra classes on the control stack. |
| adapt | boolean | true | When true, night mode applies a generated companion from light tokens. |
| minContrast | number | 4.5 | WCAG contrast target for body and muted text. |
DAY/NIGHT samples your light :root tokens, builds an OKLCH companion (same hue, darker canvas, type to AA), and writes it onto the page. The three columns still show Light / Naive crush / Adapt for Kiln, Uptime, Dusk, and Edition. shadcn/ui ships a class toggle and two token sheets you write by hand — not a runtime companion from light tokens.