Scroller
A row (or column) of items that glides past on a loop: logos of the organisations you work with, short quotes, headlines. The items are real content, so the component treats them that way first and as motion second.
Preview
Rendered from the story the storybook (a11y) CI gate runs axe against — the preview can't show something that hasn't been verified.
Install
Two equivalent paths — the URL works in any shadcn-CLI setup; the alias works once you've registered @interlace in your components.json.
npx shadcn@latest add https://ds.interlace.tools/r/scroller.jsonnpx shadcn@latest add @interlace/scrollerBehavior
What this component does — the keyboard path, the measured colour, the text equivalent and the states it can be in. Every figure below is read out of the test or the source that enforces it by scripts/build-behavior-map.mjs, so nothing here can outlive the gate that keeps it true.
Measured contrast
packages/ui/__tests__/theme-contract-lock.test.ts ↗Every semantic colour pair this component's own source uses, measured against the shipped hexes in all 4 theme × scheme combinations. The tightest is ring on background at 8.39:1 (harbor · light), against a floor of 3:1.
| Pair | interlacelight | interlacedark | harborlight | harbordark | Floor |
|---|---|---|---|---|---|
| ring on backgroundfocus ring (SC 2.4.13) | 8.80:1 | 11.79:1 | 8.39:1 | 10.03:1 | 3.0:1SC 1.4.11 |
| ring on cardfocus ring inside a card | 8.80:1 | 10.92:1 | 8.86:1 | 9.10:1 | 3.0:1SC 1.4.11 |
| foreground on backgroundbody copy | 19.65:1 | 16.97:1 | 17.74:1 | 16.19:1 | 4.5:1SC 1.4.3 |
Text pairs are held to 4.5:1 (WCAG 2.2 SC 1.4.3); borders, rings and chart axes to 3:1 (SC 1.4.11 non-text). Bold is the worst cell in the row — the one a brand fork has to keep an eye on.
Runtime contract
packages/ui/vitest.config.ts ↗Where it renders, how narrow it survives, and whether its lines are inside the coverage gate — three answers a consumer needs before the paste, not after the bug.
- Render boundary
'use client'Hydrates. It brings JavaScript to any route that imports it — put the boundary here, not at the page.
- Minimum viewport
none declaredNo width floor: it takes the width it is given. Its container owns the layout question.
- Coverage gate
not in the gateThe 100% gate currently covers
src/charts/**/*.{ts,tsx}andsrc/lib/**/*.{ts,tsx}andsrc/primitives/{button-variants,data-state-model,meter-scale,skeleton-variants}.tsandsrc/primitives/{alert,aspect-ratio,avatar,badge,box,breadcrumb,button,callout,card,checkbox,code-editor,container,data-state,focus-ring,grade-badge,grid,input,label,meter,pagination,published-date,reading-time,section,section-boundary,separator,skip-link,stack,stat-strip,tag,textarea,typography,visually-hidden}.tsxandsrc/patterns/lint-playground.tsx. This file is outside it — the glob widens in phase 7.2.
History
This component is at v1.0.0. The version is stamped as a banner into the file the install writes, so the copy in your tree says which one you have — compare it with the number above before deciding whether to re-run the install.
Unreleased1 entry
- Breakingmajor
The last borrowed motion components are replaced with Interlace's own, written from scratch. Content that moves now renders in full on the server and is announced once; decoration is a layer you drop inside any component, so a button stays a
Buttonand a card stays aCard: -CountUp: a number that counts to its value when it scrolls into view. The server renders the final figure, the box never shifts, andformattakes anyIntl.NumberFormatoptions. -Scroller: a looping row of items. Each item is announced and tabbed to once, a visible Pause button sits beside it, and under reduced motion it becomes a plain scrollable row. -StaggerList: a realulorolwhose items arrive one by one, once. Focus shows an item at once. -SheenText: a few words painted with a slow travelling gradient, on text-grade tokens, with a forced-colours fallback. -Sheen: a band of light that crosses its parent. Put it inside aButton; it sits under the label. -EdgeGlow: a light that runs around the edge of aCardor any positioned element. -GridField: graph-paper lines or a dot grid, with a few seeded (or chosen) cells that light up and fade, and withinteractive, the cell under the pointer.Buttonis nowrelative isolateandCardisrelative, soSheenandEdgeGlowwork inside them with no extra classes.Components- @interlace/count-up
- @interlace/stagger-list
- @interlace/sheen-text
- @interlace/sheen
- @interlace/edge-glow
- @interlace/grid-field
- @interlace/button
- @interlace/card
- @interlace/number-ticker
- @interlace/marquee
- @interlace/animated-list
- @interlace/animated-gradient-text
- @interlace/shimmer-button
- @interlace/border-beam
- @interlace/animated-grid-pattern
- @interlace/interactive-grid-pattern
- @interlace/grid-pattern
- @interlace/dot-pattern
- @interlace/particles
Import
Single named export.
import { Scroller } from '@/components/ui/effects/scroller';API reference
Parsed from the type declarations in the source — the same file the install writes into your tree, so this table can't drift from the component you get.
ScrollerProps
Also accepts every <div> attribute.
| Prop | Type | Description |
|---|---|---|
| children* | React.ReactNode | The items. Each child becomes one list item. |
| direction | 'left' | 'right' | 'up' | 'down' | Which way the items travel. @default 'left' |
| duration | number | Seconds for one full copy to pass. @default 40 |
| gap | keyof typeof GAP | Space between items. @default 'md' |
| edges | 'fade' | 'none' | Fade the items out at the edges, or cut them off square. @default 'fade' |
| pauseOnHover | boolean | Pause while the pointer is over the strip. @default true |
| label | string | Accessible name of the strip, read before the items. |
| pauseLabel | string | Text of the pause button. @default 'Pause' |
| playLabel | string | Text of the play button. @default 'Play' |
Accessibility
Every story for this component is rendered headlessly and checked with axe-core (wcag2aa, wcag22aa, best-practice, ACT) on every PR. That gate has no continue-on-error, so what ships has zero known violations.
What follows is what static analysis can see. Axe cannot press a key and never sees an overlay open, so the operable-without-a-mouse claim lives in Behavior instead, where the keyboard path is replayed step by step.
- Focus + keyboard behaviour
- Native element semantics — no interaction layer to get wrong.
- Focus ring (WCAG 2.2 SC 2.4.13)
- Drawn by the component's own focus-visible classes, so it holds with or without the opt-in preflight.
- Reduced motion
- Animation is gated on prefers-reduced-motion.
- ARIA in the source
aria-hiddenaria-labelaria-pressed
Examples
3 more states from the same story file.
R-rule compliance
Every primitive in @interlace/ui models to the portable 26-rule floor enforced by the componentApi ESLint preset. The cells below pin exactly where each rule applies in this file.
| Rule | Concept | Where |
|---|---|---|
| R4 | Extends native el | `div` props |
| R6 | data-slot per part | scroller / -track / -list / -item / -control |
| R7 | cn + ...rest | `cn(…, className)` + `{...props}` |
| R8 | Enums, not booleans | `direction`, `gap`, `edges` |
| R19 | Tokens only | control uses `--background`, `--border`, `--ring` |
| R25 | Client component | animation and pause state |
| R26 | A11y | list semantics, one copy announced, visible pause |
Dependencies
- Base UI primitive
- Native / no Base UI dependency
- Lucide icons
PauseIconPlayIcon
- NPM dependencies
lucide-react
- Registry dependencies
Source
The full implementation — components/ui/effects/scroller.tsx once installed.
'use client';
import { PauseIcon, PlayIcon } from 'lucide-react';
// @interlace/scroller v1.0.0 — Interlace design system.
// Docs, props and live preview: https://ds.interlace.tools/c/scroller
// What changed since: https://ds.interlace.tools/c/scroller#history
// Generated banner — keep it, the upgrade diff reads this version.
/**
* @interlace/ui — Scroller
*
* A row (or column) of items that glides past on a loop: logos of the
* organisations you work with, short quotes, headlines. The items are real
* content, so the component treats them that way first and as motion second.
*
* ## Content first
*
* - The items render once, as a list, on the server. A second copy is added
* for the seamless loop, and that copy is `aria-hidden` and `inert`, so a
…224 more lines…Registry JSON
The raw registry record — what the shadcn CLI fetches.