Skip to content
caliper ui docs

Blocks

Scroll story

Sections that change as you scroll.

Pro
pnpm dlx shadcn@latest add @caliper/scroll-story
  1. feat/date-range-picker

    date-range-picker.tsx+ onKeyDown={moveByWeek}+ aria-describedby={hint}- tabIndex={-1}

    Aiko Tanaka · 3 files · 12 tests added

    01

    Write the change

    Work in a branch. Every component ships with its states, its keyboard behaviour and its tests.

  2. Checks on #482

    • Light and darkpassed
    • Desktop and phonepassed
    • Reduced motionpassed
    • Keyboard and screen readerpassed

    02

    Check it everywhere

    Light and dark, desktop and phone, motion on and off. The same checks run on every pull request.

  3. Release 2.4.0

    ready

    Changelog written, checks green, no open blockers.

    Ship release

    03

    Ship it calmly

    A release is one button with a checklist behind it. If anything is in the way, it says exactly what.

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

When to use

Use it for

  • Walking through a product story.

Skip it when

  • Short pages.

Installation

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

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.

example.tsx
import { ScrollStory } from "@/components/ui/scroll-story"

The worked example comes with Pro

The 53-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

ScrollStory

component
PropTypeDefault
steps *readonly StoryStep[]—
labelstring"Story"
classNamestring—

Accessibility

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

KeyBehaviour
↓Moves to the next item or value.
↑Moves to the previous item or value.

Motion

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

All Showpiece sections examples