Transition

Smooth page transitions with curved or slide effects.

Loading...

Installation

npx shadcn@latest add @scrollxui/transition 

Usage

import Transition from '@/components/ui/transition';
export default function RootLayout({
  children,
}: {
  children: React.ReactNode;
}) {
  return (
    <Transition
      intro={
        <div className='text-center text-white dark:text-black'>
          <h1 className='text-3xl font-bold'>Welcome!</h1>
        </div>
      }
      introDuration={2}
      transitionDuration={1}
      type='curved'
      direction='bottom'
    >
      {children}
    </Transition>
  );
}

Examples


Curve

Top

Loading...

Left

Loading...

Right

Loading...

Slide

Top

Loading...

Bottom

Loading...

Left

Loading...

Right

Loading...

Trigger

Loading...

API Reference

Transition

Smooth page transitions with curved or slide effects.

Props

PropertyTypeDefaultDescription
introReactNode | (triggerExit: () => void) => ReactNoderequired
Content or function shown during the intro animation.
childrenReactNoderequired
Main content displayed after the intro transition completes.
introDurationnumber1.5
Duration in seconds for which the intro is displayed.
transitionDurationnumber0.9
Time in seconds for the transition animation to complete.
type'curved' | 'slide'curved
Transition style: curved clipping or sliding effect.
direction'top' | 'bottom' | 'left' | 'right'bottom
Direction from which the transition occurs.
classNamestring-
CSS classes applied to the overlay element.
skipboolean
If true, skips the intro animation and immediately shows content.
autoExitbooleantrue
If true, automatically starts exit transition after introDuration.
triggerboolean-
Optional external trigger to start the transition manually.
onFinished() => void-
Callback fired when the transition completes.

Built withby Ahdeetai.