Flip Group
Items that glide to their new place when a list is sorted, filtered or reordered, instead of jumping there: a leaderboard that re-ranks, results that narrow as a filter is typed, cards that swap. The motion tells the reader where each item went, which a…
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/flip-group.jsonnpx shadcn@latest add @interlace/flip-groupHistory
This component is at v1.0.1, first shipped in @interlace/ui 2.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.
@interlace/ui 2.0.02 entries
- Addedminor
Animations started from script now follow the brand's
--ease-*and--duration-*tokens, like the CSS does. A newmotion-tokenlib item reads them from the element that moves.Components- @interlace/motion-token
- @interlace/calendar
- @interlace/time-slot-picker
- @interlace/multi-step-form
- @interlace/commitment
- @interlace/interest-signal
- @interlace/session-composer
- @interlace/guess-reveal
- @interlace/quiz-question
- @interlace/duel
- @interlace/order-game
- @interlace/podium
- @interlace/live-room
- @interlace/word-cloud
- @interlace/answer-pad
- @interlace/tally-bars
- @interlace/standings
- @interlace/closer-game
- @interlace/stagger-list
- @interlace/reveal
- @interlace/celebrate
- @interlace/split-text
- @interlace/marker
- @interlace/rotating-text
- @interlace/draw-on
- Addedminor
New ScrollText and FlipGroup. ScrollText is one large sentence the reader brings into focus by scrolling: its words go from
--muted-foregroundto--foregroundin reading order on a ViewTimeline, so the browser drives it from the scroll position with no listener. It is read once by a screen reader, every word is always at AA contrast, and it is in full colour without ViewTimeline or under reduced motion. FlipGroup makes items glide to their new place when a list is sorted, filtered or reordered: give each adata-flip-id, render the new order, and it plays the difference (FLIP); new items fade in,rendermakes it theulorolitself, and under reduced motion items simply take their place.Components
Import
Single named export.
import { FlipGroup } from '@/components/ui/effects/flip-group';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.
FlipGroupProps
Also accepts every <div> attribute.
| Prop | Type | Description |
|---|---|---|
| duration | number | Milliseconds each glide takes. @default 400 |
| render | useRender.RenderProp | Replace the rendered element, e.g. `<ul />` or `<ol />`, so the group is the list itself. |
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
- Owned by @base-ui/react/use-render — focus trapping, dismissal and typeahead come from the headless primitive, not from us.
- Focus ring (WCAG 2.2 SC 2.4.13)
- Not focusable — no focus indicator required.
- Reduced motion
- Animation is gated on prefers-reduced-motion.
- ARIA in the source
- None — semantics come from the element or the Base UI primitive rather than hand-written ARIA.
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 | flip-group |
| R7 | cn + ...rest | `cn(className)` + `{...props}` + `useRender` |
| R13 | Ecosystem first | `useRender` to be the `ul`/`ol` itself |
| R25 | Client component | measures layout in the browser |
| R26 | A11y from native el | DOM order is the new order |
Dependencies
- Base UI primitive
- @base-ui/react/use-render
- Lucide icons
- none
- NPM dependencies
@base-ui/react
Source
The full implementation — components/ui/effects/flip-group.tsx once installed.
'use client';
import { useRender } from '@base-ui/react/use-render';
// @interlace/flip-group v1.0.1 — Interlace design system.
// Docs, props and live preview: https://ds.interlace.tools/c/flip-group
// What changed since: https://ds.interlace.tools/c/flip-group#history
// Generated banner — keep it, the upgrade diff reads this version.
/**
* @interlace/ui — FlipGroup
*
* Items that glide to their new place when a list is sorted, filtered or
* reordered, instead of jumping there: a leaderboard that re-ranks, results
* that narrow as a filter is typed, cards that swap. The motion tells the
* reader where each item went, which a jump hides.
*
* ## How to use it
*
* Wrap the list and give each moving item a stable `data-flip-id` (its key is
…111 more lines…Registry JSON
The raw registry record — what the shadcn CLI fetches.