Scroll to see parallax effect
pnpm dlx shadcn@latest add @saturation-ui/parallaxTailwind v4 — Source Scanning
The public shadcn registry installs component source into your project. If Tailwind v4 isn't scanning your components directory, add this to your CSS entry file:
@source "../components";This ensures all utility classes in CVA variants and data attribute selectors are included in your build.
import { Parallax } from "@/components/ui/parallax"<Parallax speed={-0.1}>
<img src="/hero.jpg" alt="Hero" />
</Parallax>| Prop | Type | Default | Description |
|---|---|---|---|
speed | number | -0.1 | Parallax speed factor. Negative = moves slower than scroll (recedes), positive = faster. |
className | string | — | Additional CSS classes. |
children | React.ReactNode | — | Content to apply parallax effect to. |
On This Page