Skip to content

Composition

ScrollShowcase

A whole feature section: a story told in steps, reveals as you scroll, and a strip of names below.

Scroll composition: StickyScrollStory + ScrollReveal + optional Marquee; all copy comes from props

  • Composition
  • Reduced motion: opacity-only
  • 2.57 KB gzip
  • Layout shift 0
View the source Spec sheet as Markdown

Install

Install
pnpm dlx shadcn@4.21.1 add @frictionborn/scroll-showcase

Playground

Scroll inside the frame.

Your code
import { ScrollShowcase } from "@/components/ui/scroll-showcase";

<ScrollShowcase
  headline="Your section headline"
  description="One sentence about it."
  steps={steps}
 />

In a full example

The full example loads as you scroll to it.

Accessibility

  • Sections are named through aria-labelledby (the headline, and the specs heading when you pass one) or aria-label (marqueeLabel when you pass one); ids are generated per instance with useId, so two sections on one page never clash. Heading levels run h2 (headline), h2 (each step title, from StickyScrollStory), h3 (specsHeading), h4 (spec labels): place the section under an h1 and check the outline for your page. media.alt applies only to media.type 'image'. Every colour is a host token (--background, --foreground, --primary, --muted-foreground, --card, --border) with a system-colour fallback; contrast follows your theme: measured on real pixels in a fresh Next 16 app with shadcn's default tokens (sample content, light and dark, 1440 and 390 px) every text element was at least 4.7:1 (light) and 6.9:1 (dark); verify your own content.
  • Keyboard: DOM order matches visual order; the only added focusable element is the marquee pause button, and focus inside the marquee pauses it
  • Touch: At viewport width 768px and below the story is stacked without sticky positioning
  • WCAG criteria it is built for: 2.1.1, 2.2.2, 2.4.1, 2.4.6

Props

PropTypeDefaultWhat it does
headlinestringnoneRequired. Primary section headline rendered as an h2.
descriptionstringnoneRequired. Section narrative description below the headline.
stepsStoryStep[]noneRequired. Narrative steps for StickyScrollStory ({ id, title, description, badge?, media }).
eyebrowstringnoneOptional. Eyebrow badge above the headline.
specsScrollShowcaseSpec[]noneOptional. Specifications / highlights grid items ({ metric, label, detail }).
specsHeadingstringnoneOptional. Heading above the specifications grid. Nothing is rendered when omitted.
specsEyebrowstringnoneOptional. Small label above the specifications heading. Nothing is rendered when omitted.
showMarqueebooleantrueShows the marquee ticker when marqueeItems is non-empty.
marqueeItemsReact.ReactNode[]noneOptional. Array of items to display in the marquee ticker.
marqueeLabelstringnoneOptional. Label above the marquee ticker, also its accessible name. Nothing is rendered when omitted.
smoothScrollbooleanfalseWraps the composition in the SmoothScroll provider (off by default).
pausedbooleanfalseUniversal pause prop. Passed to the reveals, the story, the marquee and SmoothScroll (the reveals only react when the browser lacks CSS scroll-driven animation).
noncestringnoneOptional CSP nonce forwarded to the <style> element of every item the section renders.
classNamestringnoneOptional. No default. Additional CSS class names on the root container. Any other HTML attribute (id, data-*, aria-*, event handlers) is spread on the root element; handlers the item uses itself are composed, not replaced.
styleReact.CSSPropertiesnoneOptional. No default. Inline styles on the root container, merged last (consumer wins).
refReact.Ref<HTMLDivElement>noneReceives the root <div>.

Measured on the bench

Measured by the automated bench at commit 801163e on 2026-10-21. These numbers are written by the bench, never by hand.

MeasureResult
Size, gzip2.57 KB at load, 0.02 KB loaded later
Layout shift0
Frames when nothing should moveoff screen 0, hidden tab 0, reduced motion 0
axe accessibility scan0 serious, 0 critical

Browsers it ran in

Automated Playwright runs, some with device emulation. Results from physical phones and tablets are still pending, so none are listed.

EnvironmentTierResultDateNotes
Chromium Desktop (SwiftShader)3pass2026-10-2119 passed, 0 failed
Chromium Mobile (Pixel 7 emulation)2pass2026-10-2118 passed, 0 failed
Firefox Desktop3pass2026-10-2118 passed, 0 failed
WebKit Desktop3pass2026-10-2118 passed, 0 failed
WebKit Mobile (iPhone 14 emulation)2pass2026-10-2118 passed, 0 failed

On different devices

Reduced motion (opacity-only): StickyScrollStory swaps media instantly (no transition, no translation); ScrollReveal elements are immediately visible; Marquee stops animating and renders a static row (no duplicate copy, no pause button)

TierWhat it does
T3 FullSame as tier 2
T2 StandardSticky story with CSS crossfades, scroll-linked or IntersectionObserver reveals, animated marquee
T1 LiteScrollReveal travel capped at 12px; Marquee still animates; layout depends on viewport width, not tier
T0 StaticNot gated by tier: layout stacks at viewport width 768px and below; ScrollReveal content is static; Marquee is paused with no duplicate copy

Content Security Policy

  • Works without 'unsafe-eval'.
  • Needs no reveal gate.
  • Sets inline style attributes, so allow style-src-attr 'unsafe-inline'.

Goes well with