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.

Specimen
Motion capture of the mounted demo, recorded by the harness. No audio track.
Harness screenshot of kokonut-switch-button at 375 pixels wide
Harness screenshot at 375 pixels wide. No horizontal overflow recorded.
Harness screenshot of kokonut-switch-button at 768 pixels wide
Harness screenshot at 768 pixels wide. No horizontal overflow recorded.
Harness screenshot of kokonut-switch-button 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 kokonut-switch-button
BuildOK
MountOK
Console errors0
Uncaught page errors0
Horizontal overflowclean at 375, 768, 1440
Axe critical0
Axe serious0
Axe moderate0
Axe minor0
Gzip marginal32.7 KB (98.1 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 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

Installation record for kokonut-switch-button
Declared dependencieslucide-react, radix-ui
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, 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.

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.