Skip to content
caliper ui docs

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.

Pro
pnpm dlx shadcn@latest add @caliper/layer-parallax

Signups dashboard, in layers

The grid, the chart card, the trend chip and the deploy toast

Weekly signups
Mon to Sat
+12%
Deploy finished

Mouse only. Touch, keyboard and reduced motion see the still composition.

Installs components/ui/layer-parallax.tsxDepends on @radix-ui/react-slot, lucide-reactMotion none in component source

When 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

terminal
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.

example.tsx
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
Checking your licence…

API reference

LayerParallax

component
PropTypeDefaultDescription
label *string—Accessible name of the composition.
children *ReactNode—`Layer` children, back to front.
intensitynumber—Largest shift in pixels for a layer at depth 1, 0 to 16. Controlled when set.
defaultIntensitynumber10
onIntensityChange((intensity: number) => void)—
enabledboolean—Whether the pointer moves the layers. Controlled when set.
defaultEnabledbooleantrue
onEnabledChange((enabled: boolean) => void)—
controlsbooleantrueShow the switch and the intensity slider.
statusDepthStatus"ready"
messagesDepthMessages—
onRetry(() => void)—
disabledboolean—
classNamestring—

Layer

component

Also accepts the native props of its root element and a ref.

PropTypeDefault
depth *number—
fillboolean—

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.

All Surfaces examples