Skip to content
Pixelbits
Docs / Pixel page transition
Signature

Pixel page transition

A full-screen pixel dissolve between pages, drawn on one fixed <canvas> (not thousands of elements), started with pixelTransition(). Squares fill in a noisy left-to-right sweep, then clear the same way. Reduced motion turns it into a short plain fade.

Installation

npm: import
import { PixelTransition, pixelTransition } from "pixelbits/page-transition";
shadcn: copy the source
npx shadcn add https://pixelbits.ali-moradi-develop.com/r/page-transition.json

API

<PixelTransition>

A full-screen pixel dissolve between pages, drawn on one fixed <canvas> (not thousands of elements), started with pixelTransition(). Squares fill in a noisy left-to-right sweep, then clear the same way. Reduced motion turns it into a short plain fade.

Example
// once, in the root layout
<PixelTransition />
PropTypeDefaultDescription
sizenumber32

Square size in CSS px.

durationnumber480

Duration of covering (and of uncovering) in ms.

colorstring"var(--pb-text)"

Fill color; any CSS color.

classNamestring—

Extra classes for the canvas.