Free & open-source theme, page and UI transitions for React.
Built on React 19.3 <ViewTransition> and addTransitionType, distributed with shadcn/ui.
Get Started · Theme · Page · UI
- ⚛️ React-native transitions — Driven by
<ViewTransition>,startTransition, andaddTransitionType; no manualdocument.startViewTransition - 🌗 Theme transitions — Animate light/dark switches from the click point, a control, or the viewport centre
- 🧭 Page transitions — Animate route changes, with reversed animations for back navigation
- 🧩 UI components — Tabs, carousels, lists, kanban boards and more whose state changes glide, morph and slide
- 🎨 Pure CSS styles — Every style is a small CSS file you own; tune duration and easing with CSS variables
- 📦 shadcn/ui compatible — Install the core and any style with the shadcn CLI
- 🛟 Graceful fallback — Browsers without view transitions switch instantly
- Core: Theme Transition (
ThemeTransitionProvider,useThemeTransition,ThemeTransitionScript) - Controls (4): Theme Toggle Button, Theme Toggle Switch, Theme Switcher, Animated Theme Toggler
- Styles (19): Circle Reveal, Circle Blur, Polygon Reveal, Star Reveal, Heart Reveal, Diagonal Wipe, Checkerboard Reveal, Ripple Reveal, Venetian Blinds, Spiral Reveal, Wave Reveal, Clock Wipe, GIF Frog, GIF Penguin, GIF Cat, GIF Michael Jackson, GIF Deadpool, GIF Chika, GIF Hakari Dance
- Core: Page Transition (
PageTransition,navigateWithTransition) - Styles (18): Fade, Slide, Scale, Flip, Blur, Rotate, Zoom, Curtain, Cube, Skew Slide, Page Curl, Accordion, Doorway, Book Flip, Roll, Fold, Glitch, Iris Wipe
- Core: UI Transition (
tk(),useTransitionNames,FORWARD/BACKtransition types, and the composabletk-*View Transition Classes) - Components (17): Tabs, Segmented Control, Accordion, Carousel, Stack Navigator, Step Wizard, Dynamic Island, Status Button, Number Flip, Add to Cart, Morphing Popover, Product Gallery, Layout Switcher, Animated List, Filter Grid, Sortable Table, Kanban Board
transition-kit requires react and react-dom 19.3 or later.
Add the registry to your components.json:
{
"registries": {
"@transition-kit": "https://transition-kit.space/r/{name}.json"
}
}Install a style (it pulls in the theme/theme-transition core):
npx shadcn@latest add @transition-kit/theme/circle-revealWrap your app and switch themes through the hook:
import {
ThemeTransitionProvider,
ThemeTransitionScript,
useThemeTransition,
} from "@/components/transitions/theme-transition";
export const App = ({ children }: { children: React.ReactNode }) => (
<>
<ThemeTransitionScript />
<ThemeTransitionProvider transition="circle-reveal">
{children}
</ThemeTransitionProvider>
</>
);
export const ThemeButton = () => {
const { resolvedTheme, setTheme } = useThemeTransition();
return (
<button
onClick={(event) =>
setTheme(resolvedTheme === "dark" ? "light" : "dark", { origin: event })
}
>
Toggle theme
</button>
);
};npx shadcn@latest add @transition-kit/page/slideKey the page by its route and wrap navigations:
import {
navigateWithTransition,
PageTransition,
} from "@/components/transitions/page-transition";
<PageTransition id={pathname} transition="slide">
{children}
</PageTransition>;
navigateWithTransition(() => navigate("/about"));
navigateWithTransition(() => history.back(), { direction: "back" });Install a component (it pulls in the ui/ui-transition core and any shadcn primitives it uses):
npx shadcn@latest add @transition-kit/ui/tabsUse it like any shadcn component; no provider is needed:
import {
Tabs,
TabsContent,
TabsList,
TabsTrigger,
} from "@/components/transitions/tabs";
<Tabs defaultValue="account">
<TabsList>
<TabsTrigger value="account">Account</TabsTrigger>
<TabsTrigger value="password">Password</TabsTrigger>
</TabsList>
<TabsContent value="account">Account settings.</TabsContent>
<TabsContent value="password">Change your password.</TabsContent>
</Tabs>;See the docs for every style, the controls, the UI components, and customization options.
Styles rely on the View Transition API and view-transition-class:
| Browser | Version |
|---|---|
| Chrome / Edge | 125+ |
| Safari | 18.2+ |
| Firefox | 144+ |
In other browsers, React applies the update without an animation, so themes, pages and components switch instantly.
git clone https://github.com/shadcn-labs/transition-kit.git
cd transition-kit
pnpm install
pnpm dev # docs site at http://localhost:3000
pnpm registry:build # regenerate registry.json and public/r
pnpm build # registry + Vite build
pnpm typecheck
pnpm check # lint and format (ultracite)
pnpm deploy # build and deploy to Cloudflare WorkersThe site is built with TanStack Start, Vite, and Fumadocs and deployed to Cloudflare Workers. Registry source lives in registry/; AGENTS.md documents the architecture.
The transition-kit community lives on GitHub, where you can ask questions, share ideas, and show what you've built.
Contributions are welcome. See CONTRIBUTING.md to get the repo running locally and land a change, and use issues and discussions to collaborate. By participating, you agree to the Code of Conduct.
Please do not open public issues for security vulnerabilities. Follow SECURITY.md and report them privately through GitHub Security Advisories.
- Created by Abdullah Mukadam.
- Part of Shadcn Labs.
Made with contrib.rocks
