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/

GIF Cat

A dancing cat reveals the new theme through an expanding mask. A React dark mode transition built on View Transitions, installed with the shadcn CLI.

Installation

$ pnpm dlx shadcn@latest add @transition-kit/theme/gif-cat

Usage

<ThemeTransitionProvider transition="gif-cat">
  {children}
</ThemeTransitionProvider>
const { toggleTheme } = useThemeTransition();
 
<button
  type="button"
  onClick={(event) => toggleTheme({ transition: "gif-cat", origin: event })}
>
  Toggle theme
</button>;

API Reference

PropTypeDefaultDescription
transitionstringThe provider's transition"gif-cat" for this style: on the provider for every change, or per change with setTheme / toggleTheme.
durationnumber1500Milliseconds on the provider. Overrides this style's 1500ms timing. Edit var(--tk-theme-duration, 1500ms) in the style's CSS to change only this style.
easingstringcubic-bezier(0.16, 1, 0.3, 1)Easing on the provider. Overrides this style's easing. Edit var(--tk-theme-easing, cubic-bezier(0.16, 1, 0.3, 1)) in the style's CSS to change only this style.
origin{ clientX: number; clientY: number } | ElementThe viewport centrePass the click event to start at the pointer, or an element to start at its centre.

Notes

The mask is a GIF loaded from Tenor:

https://media.tenor.com/GQAsycjoZG8AAAAi/scuba-scuba-cat.gif

Until the browser has downloaded it, the mask is empty and the theme switches when the transition ends. Preload it so the first transition plays, or download it and serve it from your own domain:

<link
  rel="preload"
  as="image"
  href="https://media.tenor.com/GQAsycjoZG8AAAAi/scuba-scuba-cat.gif"
/>

If you swap in another image, keep the reveal centred by updating the aspect ratio (height ÷ width) used in the mask-position calculations.