For the complete documentation index, see llms.txt. Markdown variants are available by appending .md to any URL or sending an Accept: text/markdown header. An agent skill is available at /.well-known/agent-skills/site-skill.md.
Shadcn Labs/

Theme Morph Button

An icon button whose sun and moon morph while the theme transitions. A React dark mode toggle built on View Transitions, installed with the shadcn CLI.

Installation

$ pnpm dlx shadcn@latest add @transition-kit/theme-morph-button

Usage

import { ThemeMorphButton } from "@/components/transitions/theme-morph-button";
<ThemeMorphButton />
<ThemeMorphButton transition="circle-reveal" />

API Reference

ThemeMorphButton

PropTypeDefaultDescription
transitionstringThe provider's transitionStyle slug such as "circle-reveal". Install the style first.
...propsComponentProps<"button">-Spread onto the <button>. Calling event.preventDefault() in onClick skips the theme change.