Skip to main content
Clever Ops

Chapter Snap

Full-viewport chapters with CSS proximity scroll-snap, never a mandatory trap, and a side rail of dots with mono numerals that tracks the active chapter through honest anchor links.

Preview & code

Loading Chapter Snap preview

Installation

pnpm dlx shadcn@latest add @cleverui/scroll-chapter-snap

Requires the @cleverui registry in your components.json, a one-off, two-line setup.

Usage

tsx
import { ScrollChapterSnap } from '@/components/blocks/scroll-chapter-snap'
Exampletsx
import { ScrollChapterSnap } from '@/components/blocks/scroll-chapter-snap'

export default function ScrollChapterSnapDemo() {
  return (
    <ScrollChapterSnap
      chapters={[
        {
          id: 'intake',
          kicker: 'Field',
          title: 'Every receipt lands on one board.',
          body: 'Invoices, packing slips, and portal exports arrive in a single queue. Meridian extracts against your chart of accounts, not a generic template, so analysts stop re-keying amounts that already exist somewhere in the stack.',
        },
        {
          id: 'match',
          kicker: 'Policy',
          title: 'Match with the rule still attached.',
          body: 'Tolerance bands, cost-center gates, and dual-approval thresholds travel with every line. Controllers no longer hunt for the spreadsheet that defined “close enough.” The policy is the match engine.',
        },
        {
          id: 'exceptions',
          kicker: 'Morning',
          title: 'Exceptions route before 7am.',
          body: 'Unmatched lines get an owner and age overnight. The morning board shows judgment calls only, scavenger hunts stay in the log. Median exception age fell from 41 hours to under six.',
        },
        {
          id: 'seal',
          kicker: 'Audit',
          title: 'Audit packs seal themselves.',
          body: 'Export a signed pack for any close window: decisions, overrides, and source hashes. External auditors stop asking for screenshots. Close dropped from nine calendar days to three.',
        },
      ]}
    />
  )
}

API reference

ScrollChapterSnap accepts the following props.

PropTypeDefaultDescription
chapters*ChapterSnapItem[]3–6 full-viewport chapters; id doubles as the same-page anchor target
showRailbooleantruerender the sticky chapter rail on lg screens
snapbooleantrueenable proximity snap while mounted; disable for plain stacked flow

…plus everything from React.HTMLAttributes<HTMLElement>: className, event handlers, aria attributes and the rest pass straight through.

Referenced types

Typestsx
export interface ChapterSnapItem {
  id: string
  kicker?: string
  title: string
  body: string
}

Frequently asked questions

How do I install the Chapter Snap component?

Register the @cleverui registry in your components.json ("@cleverui": "https://cleverops.com.au/r/{name}.json"), then run `npx shadcn@latest add @cleverui/scroll-chapter-snap`. The shadcn CLI copies the source into your project, you own the code from that point. You can also copy the source directly from this page.

What dependencies does Chapter Snap require?

Chapter Snap uses motion on top of React and Tailwind CSS. You don't need to install it manually, the shadcn CLI resolves and installs npm dependencies automatically when you add the component.

Can I theme Chapter Snap to match my brand?

Yes. The component is styled entirely with Tailwind utilities over standard design tokens (primary, background, muted, border), so it inherits your existing shadcn/ui theme automatically. Change your CSS variables and the component follows, no source edits needed for palette, radius, or fonts.

Want this built for you?

CleverUI is built by the Clever Ops web team. If you'd rather ship a hand-coded, fast, custom website than assemble one, we build them for Australian businesses every week.

Explore web development services