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

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.