AtroUIAtroUI
DocsBlog
StarOwn the UI
  • Introduction
  • Installation
  • Host APIs
  • Registry
  • Theming
  • Brand kit
  • Identity kit
  • Launch workflow
  • Compare
  • Changelog
  • Blog
  • Updates
  • ButtonCLI
  • CardCLI
  • Form SelectCLI
  • TextareaCLI
  • BreadcrumbsCLI
  • ProseCLI
  • Founder AvatarCLI
  • Theme ToggleCLI
  • Adaptive Theme SwitchCLI
  • Theme ProviderCLI
  • LogoCLI
  • Mockup FrameCLI
  • TimelineCLI
  • Fade InCLI
  • StaggerCLI
  • Scroll ProgressCLI
  • Site HeaderCLI
  • Site FooterCLI
  • Bold FooterCLI
  • HeroCLI
  • PrincipleCLI
  • WorkCLI
  • CraftsCLI
  • LabCLI
  • WhoCLI
  • PricingCLI
  • Feature GridCLI
  • Logo CloudCLI
  • FAQCLI
  • Contextual CTACLI
  • Exit IntentCLI
  • Contact FormHost API
  • Calendly EmbedCLI
  • Waitlist FormHost API
  • Newsletter FormHost API
  • JournalCLI
  • Social ShareCLI
  • ResourcesCLI
  • Before / AfterCLI
  • Case StudyCLI
  • AR PortfolioCLI
  • Made With EmbedCLI
  • Count UpCLI
  • Deadline CountdownCLI
  • CurrentlyCLI
  • Project ListCLI
  • Log PreviewCLI
  • ChangelogCLI
  • Command MenuCLI
  • RevealCLI
  • Theme Toggle IconCLI
  • Site Header NarrowCLI
  • Site Footer NarrowCLI
  • Social FloatCLI
  • Reading ShelfCLI
  • Personal HeroCLI
  • ResumeCLI
  • Local ClockCLI
  • Weather ChipCLI
  • Stack ListCLI
  • OG ExamplesCLI
  • OG Live PreviewCLI
  • OG WorkspaceHost API
  • Thumbnail PreviewCLI
  • Thumbnail WorkspaceHost API
  • Project PlannerCLI
  • Scope ChatHost API
  • Live DashboardCLI
  • Analytics ProviderCLI
  • JSON-LDCLI
  • Testimonial SchemaCLI

Loading

Primitive

CLI registry

Adaptive 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

01

Preview

$npx shadcn@latest add @atroui/theme-adapt

Palettes

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 schedule

Naive 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 schedule

Adapt

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 schedule

Source lands in your repo. Setup: Installation · Registry catalog.

02

Usage

Requires next-themes ThemeProvider. The three-way Light / System / Dark pill is still @atroui/theme-toggle. Use this when a naive invert would hide body copy or flatten a designed light canvas.
03

API reference

PropTypeDefaultDescription
classNamestring-Extra classes on the control stack.
adaptbooleantrueWhen true, night mode applies a generated companion from light tokens.
minContrastnumber4.5WCAG 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.

PreviousTheme ToggleNextTheme Provider