Ballmac UI home

Sticky Scroll

Scroll-driven storytelling: text steps scroll past while one visual stays pinned and crossfades to match, with each visual inline on small screens.

  1. Plan the work together

    Turn a goal into tasks, owners and dates. Everyone sees the same plan, and changes show up for the whole team as they happen.
  2. Talk where the work is

    Comment on a task, a file or a single line. Mentions notify the right person, and the conversation stays attached to the work.
  3. Know how it went

    See what shipped, what slipped and where time went. Reports update on their own, so the review starts with facts.

Installation

$ pnpm dlx shadcn@latest add @ballmac/sticky-scroll

Usage

import { StickyScroll } from "@/components/ballmac/sticky-scroll"

The full example is in the Code tab above.

Examples

Visual on the left

  1. Capture

    Step 1. Each step keeps its own visual on the left while you read.
  2. Organize

    Step 2. Each step keeps its own visual on the left while you read.
  3. Share

    Step 3. Each step keeps its own visual on the left while you read.

API reference

PropTypeDefault
items*

Steps, in reading order.

StickyScrollItem[]—
visualSide

Which side the sticky visual sits on from the `lg` breakpoint up.

"left" | "right""right"
stickyOffset

Distance from the top of the viewport where the sticky visual stops, in pixels.

number96
onActiveChange

Called when the active step changes.

(id: string) => void—
container

A scrollable element that contains the steps, when the page itself does not scroll (panels, previews).

React.RefObject<HTMLElement | null>—
stepMinHeight

Minimum height of each step from `lg` up. Longer steps give the reader more time on each visual.

string"70svh"

Also accepts the standard attributes of its root element.

Accessibility

KeyAction
Reading orderSteps are an ordered list; the pinned visual is decorative and hidden from assistive technology
Reduced motionNo crossfade or scale

Quality scorecard

7/7

Every applicable check passes

Measured in Chromium 153.0.8010.12 on October 19, 2026, on version 1.0.0, across 2 examples.

How we measure
  • Passed: Accessibility scan

    No serious or critical issues in light and dark, on a phone and a desktop (axe-core 4.13.0, WCAG 2.1 AA and best-practice rules).

  • Passed: Small screens

    No sideways scrolling at 360, 390 or 1280 px wide.

  • Passed: Reduced motion

    No endless animation to begin with.

  • Passed: Right to left

    Mirrors correctly in Arabic, Hebrew, Persian and Urdu layouts (0% of elements off the mirror, limit 15%).

  • Passed: Clean console

    No console errors or React hydration errors while loading.

  • Passed: Keyboard

    2 tab stops, each showing a visible change when it takes focus. 2 documented keys.

  • Not applicable: Loading, empty and error

    Does not show data or take submissions.

  • Passed: Automated tests

    Covered by sticky-scroll.test.tsx.

  • For information: Footprint

    2.1 KB of source (gzip) in 1 file. Installs motion.

Automated checks find a subset of problems and do not replace testing with a screen reader and a keyboard in your own app. What they miss.

Use with AI

items: {id,title,description,visual}. The step nearest the middle of the viewport is active (aria-current=step) and its visual shows in the pinned panel. With the shadcn MCP server set up (guide), ask your agent:

Add the Ballmac UI Sticky Scroll (@ballmac/sticky-scroll) to this project with the shadcn MCP, then use it where it fits.

Use it for

  • Feature tours on landing pages
  • Step-by-step explanations with a matching picture

Not for

  • Short lists of benefits; use a plain grid
  • Content that must all be visible at once

Registry JSON: https://ui.ballmac.com/r/sticky-scroll.json

Credits

Free to use in personal and commercial projects.

Ballmac UI Pro

Need the whole screen, not one piece?

311 premium blocks (dashboards, settings, calendars, mail, shops, onboarding), a private shadcn registry and Figma tokens. Blocks that show data come with loading, empty and error states built in.

Not ready? Try three Pro blocks free

Leave your email and the blocks appear right here, ready to copy. Yours to use in any project.