Make your AI a shadcn expert

Theme Toggle Button

Theme toggle button with animated sun/moon icon transition for React, Next.js, shadcn/ui, Tailwind CSS, TypeScript. Built on the base-ui shadcn Button.

Theme Toggle Button preview

Scroll to load preview

A beautiful toggle between sun and moon icons with smooth rotation animation. Click and watch the icons swap with a satisfying spin. This is pure UI—hook it up to your own theme logic or state. Perfect for headers and navbars. The animation is subtle but polished, exactly what users expect from a theme toggle. Built on top of the shadcn Button so every variant and size you already use just works.

Install with AI

If you've connected the shadcn.io MCP server to Claude Code, Cursor, Windsurf, or any MCP-ready AI editor, prompt your agent to install this button for you — no copy-paste, no CLI:

use shadcnio to install the theme-toggle-button button into my project

FAQ

Last updated on May 25, 2026

Was this page helpful?

Sign in to leave feedback.