Theme transitions
that actually look good
npm install css-theme-transitionGet started in seconds
Install, import, done. No provider, no wrapping, no config.
npm install css-theme-transitionimport ThemeTransition from "css-theme-transition"
import "css-theme-transition/theme-transition.css" // optional
// Tailwind-only layout using the same CSS variables
export default function Header() {
return (
<header>
<div className="h-screen w-screen flex justify-center items-center bg-[var(--bg)] text-[var(--text)]">
<div className="h-[50px] w-[50px] flex justify-center items-center">
<ThemeTransition
variant="circle-pivot"
position="top-left"
className="theme"
/>
</div>
</div>
</header>
)
}All Components
Click any card to activate the toggle, then click the icon to preview the transition live. Copy the snippet or install via your package manager.
Circle
Simple circular reveal from the center of the screen.
<ThemeTransition variant="circle" />Circle [Blur]
Blurred circular reveal that expands outwards.
<ThemeTransition variant="circle-blur" />Circle Pivot [Top Right]
Circle pivot animation expanding from the top right corner.
<ThemeTransition variant="circle-pivot" position="top-right" />Circle Pivot [Top Left]
Circle pivot animation expanding from the top left corner.
<ThemeTransition variant="circle-pivot" position="top-left" />Circle Pivot [Bottom Right]
Circle pivot animation expanding from the bottom right corner.
<ThemeTransition variant="circle-pivot" position="bottom-right" />Circle Pivot [Bottom Left]
Circle pivot animation expanding from the bottom left corner.
<ThemeTransition variant="circle-pivot" position="bottom-left" />Circle Pivot [Top Center]
Circle pivot animation expanding from the top center.
<ThemeTransition variant="circle-pivot" position="top-center" />Circle Pivot [Bottom Center]
Circle pivot animation expanding from the bottom center.
<ThemeTransition variant="circle-pivot" position="bottom-center" />Star
Star-shaped reveal animation from the center.
<ThemeTransition variant="star" />Star [Blur]
Blurred star reveal for a softer transition.
<ThemeTransition variant="star-blur" />Diamond
Diamond-shaped reveal animation from the center.
<ThemeTransition variant="diamond" />Diamond [Blur]
Blurred diamond reveal for a smooth transition.
<ThemeTransition variant="diamond-blur" />Triangle
Triangle-shaped reveal animation from the center.
<ThemeTransition variant="triangle" />Triangle [Blur]
Blurred triangle reveal for a softer effect.
<ThemeTransition variant="triangle-blur" />Hexagon
Hexagon-shaped reveal animation from the center.
<ThemeTransition variant="hexagon" />Hexagon [Blur]
Blurred hexagon reveal for a smooth transition.
<ThemeTransition variant="hexagon-blur" />Navbar Examples
5 real-world navbar patterns each using a different ThemeTransition variant. Click “Copy code” to grab the full responsive snippet.
Minimal Clean
circle-pivot / top-rightClean, modern navbar with circle-pivot expanding from the top-right corner.
import ThemeTransition from "css-theme-transition"
export function Navbar() {
return (
<nav className="flex items-center justify-between h-14 px-6 border-b">
<span className="font-semibold">Acme</span>
<div className="flex items-center gap-2">
<a href="#">Docs</a>
<ThemeTransition variant="circle-pivot" position="top-right" />
</div>
</nav>
)
}Glassmorphism
starFrosted glass pill navbar with a star-shaped View Transition reveal.
import ThemeTransition from "css-theme-transition"
export function Navbar() {
return (
<nav className="backdrop-blur-md bg-white/60 border border-white/80 rounded-xl flex items-center h-12 px-5">
<span className="flex-1 font-semibold">NexUI</span>
<ThemeTransition variant="star" />
</nav>
)
}Dashboard
diamondDashboard layout with pill-tab navigation and diamond transition.
import ThemeTransition from "css-theme-transition"
export function Navbar() {
return (
<nav className="flex items-center h-14 px-6 border-b gap-4">
<span className="font-bold w-40">Dataflow</span>
<div className="flex-1 flex justify-center">
{/* pill tab nav */}
</div>
<ThemeTransition variant="diamond" />
</nav>
)
}Bold Editorial
hexagonDark background editorial style with hexagon reveal animation.
import ThemeTransition from "css-theme-transition"
export function Navbar() {
return (
<nav className="flex items-center h-14 px-6 bg-black">
<span className="flex-1 font-black text-white uppercase tracking-widest">
Forma
</span>
<ThemeTransition variant="hexagon" />
</nav>
)
}Floating Pill
circle-blurCentered floating pill navbar with smooth circle-blur transition.
import ThemeTransition from "css-theme-transition"
export function Navbar() {
return (
<div className="flex justify-center py-3">
<nav className="flex items-center h-11 px-2 rounded-2xl border bg-white shadow-md">
<span className="px-3 font-bold text-xs">Luminary</span>
<a href="#" className="px-3 py-1.5 text-xs rounded-xl bg-black text-white">Features</a>
<ThemeTransition variant="circle-blur" />
</nav>
</div>
)
}