Measured entry
magicui-animated-theme-toggler
buttonskeuomorphismmotion on file
A client-side React theme button that swaps sun and moon icons while revealing the new theme through a View Transitions clip mask. It ships as a shadcn registry component, uses lucide-react and React DOM, imports the shared cn helper, expects dark mode on the document class, and includes registry CSS for the transition snapshots.



Measured
Every value below was written by the harness on the run that produced the frames above. None of it is derived from the prose.
| Build | OK |
|---|---|
| Mount | OK |
| Console errors | 0 |
| Uncaught page errors | 0 |
| Horizontal overflow | clean at 375, 768, 1440 |
| Axe critical | 0 |
| Axe serious | 0 |
| Axe moderate | 0 |
| Axe minor | 0 |
| Gzip marginal | 28.4 KB (93.8 KB build, 65.4 KB baseline) |
| Bare mode | FAIL |
| Provider required | NO |
| Demo used | written from the component source API |
What the harness recorded
BARE BUILD
✗ Build failed in 5.47s error during build: [vite:load-fallback] Could not load <sandbox>/src/lib/utils (imported by src/cut/animated-theme-toggler.tsx): ENOENT: no such file or directory, open '<sandbox>/src/lib/utils'
Verdict
A polished choice for apps already built around document-class theming, with sensible controlled and unsupported-browser paths. It builds and mounts in the prepared harness, but needs a shadcn-style setup because the bare project cannot resolve its shared utility import.
Use it if
- You want a compact light and dark theme control with a shaped reveal from the trigger or viewport center.
- Your app already uses a document-level dark class and can supply controlled theme state or accept local storage persistence.
- You want the toggle to fall back to an immediate theme change when View Transitions are unavailable.
Skip it if
- Your theme system uses attributes, scoped containers, or tokens without a dark class on the document root.
- You need a server-only control or cannot ship a client component that touches the document and local storage.
- You do not want a theme action to animate the entire page snapshot.
- Your project cannot provide the shadcn utility alias and transition CSS expected by the source.
Install
| Declared dependencies | lucide-react |
|---|---|
| Missing on install | none |
| Bare install | fails once the shadcn-style helpers are removed, so it needs that setup |
| Provider | no provider required in the harness |
In a non-shadcn project, install lucide-react, add or replace the cn utility and its import alias, copy the registry's view-transition CSS, and ensure your theme layer toggles the dark class on the document root. For app-owned persistence, pass the controlled theme value and change callback.
Source and credit
This page is a review, not a copy. The component source lives with its author and this site does not republish it. Read the license before you use anything.
Author repository
github.com/magicuidesign/magicuiAlternatives
Other published entries for the button pattern, ordered by what they measured: mounts first, then clean axe scans, then bare-mode passes, then the smaller bundle.
- neu-buttonneumorphism
- Renders
- YES
- A11y
- 0
- Gzip
- 17.8KB
- Bare
- pass
- Prov
- NO
- clay-buttonclaymorphism
- Renders
- YES
- A11y
- 0
- Gzip
- 18.2KB
- Bare
- pass
- Prov
- NO
- tripled-animated-radio-shadcnuiminimal-flat
- Renders
- YES
- A11y
- 0
- Gzip
- 58.2KB
- Bare
- pass
- Prov
- NO
- ruixen-glow-link-buttonliquid-glass
- Renders
- YES
- A11y
- 0
- Gzip
- 58.9KB
- Bare
- pass
- Prov
- NO
- tripled-mood-gradient-button-shadcnuigradient-glow
- Renders
- YES
- A11y
- 0
- Gzip
- 59.2KB
- Bare
- pass
- Prov
- NO
- ruixen-glass-ai-cardliquid-glass
- Renders
- YES
- A11y
- 0
- Gzip
- 59.5KB
- Bare
- pass
- Prov
- NO