Measured entry
kokonut-switch-button
buttondark-futuristicmotion on file
A client-side light and dark theme toggle rendered as a styled button with a rotating sun icon, optional label, hover sheen, and size choices. It ships as a shadcn registry component and depends on React, next-themes, Lucide, Tailwind utility classes, the shadcn Button primitive, and the cn helper.



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 | 32.7 KB (98.1 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 1m 16s error during build: [vite:load-fallback] Could not load <sandbox>/src/lib/utils (imported by src/cut/components/kokonutui/switch-button.tsx): ENOENT: no such file or directory, open '<sandbox>/src/lib/utils'
Verdict
A polished fit for an existing shadcn theme stack, with clean mounting and no detected accessibility or viewport issues. It needs a shadcn-style setup and is not drop-in for a bare React project. Check whether its current-theme label matches your product language.
Use it if
- You already use next-themes and want a compact theme toggle with visible interaction feedback.
- Your interface uses shadcn primitives and Tailwind styling, so the imported Button and utility classes fit directly.
- You need labeled and icon-only variants across several control sizes.
Skip it if
- Your app does not use next-themes or does not expose light and dark themes.
- You need a framework-neutral control without shadcn aliases, Tailwind utilities, or a shared cn helper.
- You want the control label to describe the theme that clicking will activate, since this implementation labels the current theme.
- You need multiple visual variants, because the public variant prop currently offers only the minimal style.
Install
| Declared dependencies | lucide-react, radix-ui |
|---|---|
| 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, add next-themes with its theme provider, Lucide React, Tailwind support for the component's utility classes, a compatible Button primitive, the cn class-merging helper, and aliases for the component and utility import paths. Preserve client-side rendering for theme access.
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/kokonut-labs/kokonutuiAlternatives
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