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.

Specimen
Motion capture of the mounted demo, recorded by the harness. No audio track.
Harness screenshot of magicui-animated-theme-toggler at 375 pixels wide
Harness screenshot at 375 pixels wide. No horizontal overflow recorded.
Harness screenshot of magicui-animated-theme-toggler at 768 pixels wide
Harness screenshot at 768 pixels wide. No horizontal overflow recorded.
Harness screenshot of magicui-animated-theme-toggler at 1440 pixels wide
Harness screenshot at 1440 pixels wide. No horizontal overflow recorded.

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.

Harness measurements recorded for magicui-animated-theme-toggler
BuildOK
MountOK
Console errors0
Uncaught page errors0
Horizontal overflowclean at 375, 768, 1440
Axe critical0
Axe serious0
Axe moderate0
Axe minor0
Gzip marginal28.4 KB (93.8 KB build, 65.4 KB baseline)
Bare modeFAIL
Provider requiredNO
Demo usedwritten 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

Installation record for magicui-animated-theme-toggler
Declared dependencieslucide-react
Missing on installnone
Bare installfails once the shadcn-style helpers are removed, so it needs that setup
Providerno 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.

License
MIT
Record published
2026-08-13

Alternatives

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.