Skip to content
caliper ui docs

Pro

Scroll effects

Tools for effects that follow scroll position, such as progress and reveals.

Pro
pnpm dlx shadcn@latest add @caliper/scroll-effects

Field notes, issue 14

A long read in the help centre. The bar shows how far in you are.

Designing for the quiet middle

Most of a product's life is ordinary use. Motion should explain what changed and then get out of the way.

Start from the second visit

The first run gets the attention, but the hundredth decides whether people stay. Design the screen someone opens every morning.

Let the data set the pace

A table of twelve rows and a table of twelve thousand need different tools. Choose density by what people scan, not by what fits.

Leave a trail

When something moves, saves or fails, say so where it happened. People should never have to wonder whether it worked.

Installs components/ui/scroll-effects.tsxDepends on none beyond ReactMotion honours reduced motion

When to use

Use it for

  • Adding a reading progress bar or a reveal on scroll.

Skip it when

  • Effects would distract from reading.

Installation

terminal
pnpm dlx shadcn@latest add @caliper/scroll-effects

Adds its 2 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 ScrollEffect, ScrollProgress and useScrollVars.

example.tsx
import { ScrollEffect, ScrollProgress, useScrollVars } from "@/components/ui/scroll-effects"

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

ScrollEffect

component
PropTypeDefaultDescription
children *ReactNode—
effect"clip" | "scale" | "fade-up" | "parallax""fade-up"
rootRefObject<HTMLElement | null>—A scrollable ancestor to measure against. Omit to use the window.
asElementType"div"
classNamestring—

ScrollProgress

component
PropTypeDefault
targetRefObject<HTMLElement | null>—
classNamestring—

useScrollVars

component

No props of its own; it re-exports a primitive and takes that primitive’s props.

Accessibility

It is built on native elements and keeps aria-hidden in step with state.

No custom key handling; Tab and the native activation keys do the work.

Motion

It checks prefers-reduced-motion itself and settles immediately instead of travelling. Every state is still reachable.

All Surfaces examples