Install via CLI.
GlideCN does not distribute as an NPM runtime dependency. Instead, we generate the exact source code directly into your repository so you own the animation logic completely.
Zero Black-Box Dependencies
When you initialize, GlideCN adds exactly the code you need directly into your project's component directory. You own it, you can modify it, and it won't break on upstream updates.
Framework Integration
Setup requires just two components: a provider and a page wrapper.
Wrap Your Root Layout
Add <GlideCNProvider> to coordinate route changes and manage the dual-frame crossfade.
// app/layout.tsximport { GlideCNProvider, GlideCN } from '@/components/glidecn';export default function RootLayout({ children }: { children: React.ReactNode }) { return ( <html lang="en"> <body> <GlideCNProvider defaultTransition="cube"> <GlideCN> {children} </GlideCN> </GlideCNProvider> </body> </html> );}Wrap Your Pages
Wrap each route segment in <Page> and optionally override the default transition animation per-route.
import { Page } from '@/components/glidecn';export default function Dashboard() { return ( <Page transition="circular-portal" duration={0.7}> <h1>Dashboard</h1> </Page> );}Curated Transition Registry
Pull down specific transitions to your project using the CLI without blowing up your bundle size.
npx glidecn-cli add cubenpx glidecn-cli add circular-portalnpx glidecn-cli add origami-unfoldnpx glidecn-cli add ink-spreadDynamic Hooks
Build user preferences, presentation modals, or context-aware animations by updating the transition programmatically at runtime using the useGlide() hook.
const { setTransition } = useGlide();return ( <button onClick={() => setTransition('cube')} > Switch to Cube </button>);