Pro
Layer parallax
A composition of layers that shift against each other as the mouse moves, each by its own depth, with the whole scene tilting no more than 5 degrees. It explains how a screen is built: the grid behind, the card on it, the chip and the toast in front. It is for docs and demonstration stages, never for controls or moving text.
pnpm dlx shadcn@latest add @caliper/layer-parallaxWhen to use
Use it for
- Docs and landing sections that show the layers of a screen or a component.
- A demonstration stage that needs a little life without autoplay.
Skip it when
- Anything people must click or read while it moves.
- Hero art for its own sake; a still image says the same.
Decisions
Why it is built this way, so you know what to keep when you change your copy.
Behaviour
- Mouse only
- Touch, keyboard and reduced motion see the still composition, which is the complete picture. Nothing here takes focus.
Styling
- Small, capped movement
- A layer shifts at most 16px and the scene tilts at most 5 degrees, so text stays flat to read. A switch and a slider let the viewer turn it down or off.
Usage
- Layer takes a depth
- 0 stays put, 1 shifts by the full intensity. You place each layer with className or style, or pass fill for a backdrop.
Installation
pnpm dlx shadcn@latest add @caliper/layer-parallax
Adds its 9 files to components/ui/, each with its own stylesheet, and installs their packages. Pro installs with your access token, set up once per project. See Pro access. The first part also adds Caliper UI’s tokens; import them once as in Installation.
Usage
Import it from your copy of the source. The example behind the preview comes with the source. It is built from LayerParallax and Layer.
import { LayerParallax, Layer } from "@/components/ui/layer-parallax"
The worked example comes with Pro
The 41-line example behind the preview opens here, ready to copy.
- 626 Pro parts, blocks and page templates, all with source
- $149 once, with lifetime updates. No renewal
- A full refund within 14 days if it is not for you
API reference
LayerParallax
component
Layer
component
Also accepts the native props of its root element and a ref.
Accessibility
It exposes group semantics, with aria-label and aria-valuetext kept in step with state.
No custom key handling; Tab and the native activation keys do the work.
Motion
It declares no animation in its component source. Any transition comes from its stylesheet, which uses the duration tokens that collapse to instant under prefers-reduced-motion.
Related
- Tilt cardA card that tilts toward the pointer with a soft highlight.
- Exploded viewPull a composed interface apart along its depth axis so each layer can be named. Spread is one continuous value: at 0 it is the finished interface seen face on, at 1 it is the labelled stack. The list carries every name, and hovering or focusing a row lights its plane and dims the rest.
- Spotlight gridA grid where a spotlight follows the pointer.