AtroUIAtroUI
  • Getting Started
  • Installation
  • MCP server
  • Coming from…
  • Collections
  • Registry
  • Theming
  • Host APIs
  • Brand kit
  • Identity kit
  • Landing kit
  • Launch workflow
  • For agents
  • Glossary
  • Compare
  • Alternatives hub
  • vs Aceternity UI
  • vs Magic UI
  • Aceternity alternative
  • Magic UI alternative
  • Tailwind Plus alternative
  • Changelog
  • Blog
  • Updates
  • ButtonCLI
  • DialogCLI
  • Alert DialogCLI
  • MenuCLI
  • Context MenuCLI
  • Navigation MenuCLI
  • MenubarCLI
  • PopoverCLI
  • TooltipCLI
  • Preview CardCLI
  • Scroll AreaCLI
  • SeparatorCLI
  • FieldCLI
  • Number FieldCLI
  • OTP FieldCLI
  • FormCLI
  • FieldsetCLI
  • InputCLI
  • TextareaCLI
  • CheckboxCLI
  • Checkbox GroupCLI
  • RadioCLI
  • SwitchCLI
  • ToggleCLI
  • Toggle GroupCLI
  • ToolbarCLI
  • AccordionCLI
  • CollapsibleCLI
  • ComboboxCLI
  • AutocompleteCLI
  • DrawerCLI
  • TabsCLI
  • ToastCLI
  • ProgressCLI
  • SliderCLI
  • MeterCLI
  • AvatarCLI
  • CardCLI
  • Form SelectCLI
  • Motion PlaygroundCLI
  • BreadcrumbsCLI
  • ProseCLI
  • Founder AvatarCLI
  • Theme ToggleCLI
  • Adaptive Theme SwitchCLI
  • Theme ProviderCLI
  • LogoCLI
  • TimelineCLI
  • Fade InCLI
  • StaggerCLI
  • Line RevealCLI
  • Word Reveal ScrollCLI
  • Text MorphCLI
  • Copy ButtonCLI
  • Label RollCLI
  • MagneticCLI
  • TiltCLI
  • SpotlightCLI
  • Animate NumberCLI
  • Transition PanelCLI
  • Scroll ProgressCLI
  • ASCII
  • DonutCLI
  • RainCLI
  • WaveCLI
  • SparkCLI
  • BarCLI
  • BootCLI
  • WordmarkCLI
  • DecodeCLI
  • Site HeaderCLI
  • Site FooterCLI
  • Bold FooterCLI
  • HeroCLI
  • PrincipleCLI
  • WorkCLI
  • CraftsCLI
  • LabCLI
  • WhoCLI
  • PricingCLI
  • Feature GridCLI
  • Logo CloudCLI
  • FAQCLI
  • Contextual CTACLI
  • Exit IntentCLI
  • Calendly EmbedCLI
  • Waitlist FormHost API
  • Newsletter FormHost API
  • JournalCLI
  • Social ShareCLI
  • ResourcesCLI
  • AR PortfolioCLI
  • Made With EmbedCLI
  • Hero ParallaxCLI
  • Hero LampCLI
  • Logo MarqueeCLI
  • Testimonials StackCLI
  • Feature BentoCLI
  • CTA BandCLI
  • Pricing TiersCLI
  • FAQ AccordionCLI
  • Stats BandCLI
  • Integration BeamCLI
  • Showcase CarouselCLI
  • Auth SplitCLI
  • SaaS StarterCLI
  • Landing KitCLI
  • OG ExamplesCLI
  • OG Live PreviewCLI
  • OG WorkspaceHost API
  • Thumbnail PreviewCLI
  • Thumbnail WorkspaceHost API
  • Project PlannerCLI
  • Scope ChatHost API
  • Launch WorkflowCLI
  • Live DashboardCLI
  • Analytics ProviderCLI
AtroUI·Home·Components·Blog·GitHub·Changelog

Primitive · CLI

Adaptive Theme Switch

A light/dark switch that retunes muted type so vital copy stays readable when a custom light palette goes dark.

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

Installation

Agent blurb — install command + no npm UI rule. For agents

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

Source lands in your repo. Installation · Registry

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.
tsx
import { ThemeAdapt } from "@/components/ui/theme-adapt"

<ThemeAdapt />

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.

Derive night UI from the light tokens you already have

shadcn ships :root and .dark as two sheets you maintain. Adaptive Theme Switch reads computed light colors and emits a companion palette (AA muted type). It is not a full theme engine — hover, sidebar, and images stay on you.

FAQ1
Does it replace next-themes?
No. Pair with ThemeProvider. Site chrome on atroui.com still uses the classic toggle until you opt the header into ThemeAdapt.
Related
  • Button
  • Dialog
  • Alert Dialog
  • Menu

Adaptive Theme Switch

PreviousTheme ToggleNextTheme Provider
import { ThemeAdapt } from "@/components/ui/theme-adapt"

<ThemeAdapt />