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.
Mouse only. Touch, keyboard and reduced motion see the still composition.
When to use
- Docs and landing sections that show the layers of a screen or a component.
- A demonstration stage that needs a little life without autoplay.
When not to use
- Anything people must click or read while it moves.
- Hero art for its own sake; a still image says the same.
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.
API reference
LayerParallax
14 props
Layer
2 props
Also accepts the native props of its root element and a ref.
Keyboard
- No custom key handling; Tab and the native activation keys do the work.
Accessibility
It exposes group semantics, with aria-label and aria-valuetext kept in step with state.
Notes for AI
Give your coding assistant this page as Markdown instead of screenshots: the props, keyboard and examples in one file.
/docs/components/layer-parallax.mdThe index of every part is at /llms.txt.