← All proposals

Card Sequence

A new component, CardSequence, in the loading indicators family.

Net-new componentOpen in Storybook

proposals/CardSequence/HANDOFF.md129 lines · View on GitHub

Handoff: Card Sequence

What and why

Two to four cards appear one after the other with a line drawn between them while a piece of work runs. The text in each card shimmers while it works. When the work is done it lands on a headline ("You're all set.") with a yellow marker bar behind it, in light and dark. The first use is the end of the business account creation flow, after the person submits the form (a Business account card, then a Workspace card). The ticket's acceptance criteria ask for content-agnostic cards, for reuse in other flows and products.

The component only animates. The screen owns the work, the redirect, and anything that follows (a Spinner with "Taking you to your business account" while the next page loads) or goes wrong (see Accessibility and Expect to change).

Exploration and decisions

  • It started as NewBusinessAccount, fixed at two cards with eight text props. The ticket's acceptance criteria made it content-agnostic, so it became CardSequence: a list of { content, icon? }, 2 to 4.
  • New component, not a variant of SpinnerSequence (different layout, data and ending; a variant would leave half its props meaningless). The designer chose it.
  • Always plays in full: about 3 s per step, so 5 s with two cards, 8 with three, 11 with four. isComplete set early waits for the animation; set late, the last card keeps shimmering. onComplete fires 2 s after the landing so the headline can be read.
  • The shimmer is a mask over the content (any text, or a title and subtitle), not colored text, so the content stays real text and is read once.
  • The marker bar is the Badge brand pair, so it is yellow with dark text in both themes (variant 13).
  • The closing screen is a plain Spinner on the screen, not part of this component (the prototype used a circled check; the designer chose the Spinner). Nothing new to build.
  • No error state in the component (designer's choice, 2026-12-01): a failed or stuck run is the screen's to show.
  • Dropped: a title and subtitle as required props on each card (a slot is more general); a second copy of each text for the shimmer.

API

Prop Type Default Purpose
cards CardSequenceCard[] - The cards, in order, 2 to 4. Cards after the fourth are not shown. Each is { content: ReactNode; icon?: ReactNode }.
className string '' Additional class names.
completeLabel string - Headline and screen-reader text once everything is done.
isComplete boolean false Set to true when the real work is done. The last card keeps shimmering until then.
onComplete () => void - Called once, 2 s after the landing starts. Redirect from here.
workingLabel string - Headline and screen-reader text while the work runs. A trailing full stop is drawn in the brand color.

CardSequenceText (same file): title (ReactNode), subtitle (ReactNode, optional), className. A title with a smaller secondary subtitle, for the content of a card.

Variants and states: working (cards appearing, last card shimmering) and landed (headline swapped, bar wiped in, last card settled). Stories: Default (the business account flow, lands at 5 s), Three Cards, Four Cards, Free Content (no title and subtitle, no icon), Still Working (never finishes).

Tokens used

  • --pds-animation-duration-ai-shimmer, --pds-animation-timing-function-default
  • --pds-border-radius-card, --pds-border-width-default
  • --pds-color-badge-brand-background, --pds-color-badge-brand-foreground, --pds-color-border-default, --pds-color-brand-default, --pds-color-card-background, --pds-color-foreground-default, --pds-color-foreground-default-secondary, --pds-color-surface-default-secondary
  • --pds-elevation-raised
  • --pds-spacing-2xl, --pds-spacing-2xs, --pds-spacing-3xs, --pds-spacing-4xl, --pds-spacing-5xs, --pds-spacing-s, --pds-spacing-xl
  • --pds-typography-ff-compact, --pds-typography-fw-medium, --pds-typography-lh-xs, --pds-typography-size-m, --pds-typography-size-xl

Artifact values with no exact token were rounded to the closest: tile 34px to 32px (--pds-spacing-2xl), line 52px to 48px (--pds-spacing-4xl), card padding 14px to 12px (--pds-spacing-s), headline gap 22px to 24px (--pds-spacing-xl). The shimmer sweep is the PDS token (1.6 s), the artifact used 1.35 s.

Impact

impact.md: nothing reaches existing components; everything is scoped to .pds-card-sequence*. No --pds-* token is redefined. No other proposal imports or uses it. SpinnerSequence is a related proposal (same sign-up moment, different shape) and has a "see also" in its decisions.md; the two port independently.

Reused vs net-new

  • Reused: package Icon (in the stories, as the icon slot content), Badge and FlexContainer (Free Content story only). The ThinkingState shimmer idea (a highlight sweeping through the text), rebuilt as a mask.
  • Net-new: the component and CardSequenceText; classes .pds-card-sequence and its parts (list in custom.md); the registered @property --card-dim; the custom variables --card-dim, --card-start (set inline per card and line), --dim, --peak, --sequence-ease, --sequence-fade, --sequence-sweep.
  • Raw values kept on purpose (custom.md): the animation delays and durations and the constants STEP_MS, TAIL_MS, LANDING_MS (the choreography is fixed, PDS has only the shimmer duration token), the 0.58 resting dim level, the 18.75rem max width, the SVG line stroke-width, the bar inset (in em, follows the headline type) and the line's easing curve.

Accessibility

  • One polite live region (role='status', visually-hidden) holds workingLabel, then completeLabel when the animation has landed. The visible headline is aria-hidden so it is not read twice.
  • The card text is real text and is read once; the shimmer is a visual mask. The tiles, icons and line are decorative (aria-hidden). Anything that must be read goes in content, not icon.
  • No interactive elements, no focus, no keyboard behavior. Do not put interactive elements in the slots.
  • Reduced motion: no movement and no shimmer, the final layout shows, and the minimum wait is skipped.
  • Every text comes from props or the slots, so it can be translated. A trailing full stop in workingLabel is split off to color it.
  • axe (4.14) on Default and Four Cards, light and dark: 0 violations. Color contrast was inconclusive for the dimmed text and the text on the bar in dark mode. The bar text is --pds-color-badge-brand-foreground on --pds-color-badge-brand-background, the same in both themes.
  • Not verified: a screen reader, Three Cards and Free Content with axe, 375px width.
  • No error state: the screen shows an error (for example a critical Section Message with Retry) if the work fails, and sets its own timeout, because an unfinished sequence shimmers with no end.

Decisions and open questions

  • Name. CardSequence was my recommendation and the designer did not confirm it (alternatives offered: CreationProgress, CardFlow, LinkedCards). Recommended: keep it or pick before the port.
  • Shimmer speed. 1.6 s (the PDS token) against the artifact's 1.35 s. Recommended: keep the token.
  • Icon tile in dark mode. --pds-color-surface-default-secondary was looked at once, not signed off by the designer.
  • Hold before onComplete. 2 s, from the prototype. Recommended: keep, and let the screen change it if a flow needs more.

Extension or new component

New component (L1). Not an addition to an existing PDS component: it has its own timing and state (working, landed) and a different role from Spinner, ThinkingState, Skeleton or the Steppers. Nothing existing is changed and no existing story is touched.

Footprint

  • The marker bar is a pseudo-element about half an em wider than the headline on each side and slightly taller. It adds no layout size, but a parent with overflow: hidden that is tighter than the headline would clip it.
  • The component is at most 300px wide (18.75rem) and centers itself in its parent; cards fill that column, so long content wraps.
  • Entrances use a small translate and blur on the cards and headline. A parent with overflow: hidden could clip a card's blur edge during the first half second.

Dark mode and per-size values

There are no sizes. Values per theme:

Part Light Dark
Marker bar --pds-color-badge-brand-background (yellow) same (yellow)
Text on the bar --pds-color-badge-brand-foreground (dark) same (dark)
Working full stop --pds-color-brand-default (yellow) same
Card --pds-color-card-background, --pds-elevation-raised, --pds-color-border-default same tokens, theme values
Icon tile --pds-color-surface-default-secondary, --pds-color-border-default same tokens, theme values
Line and dots --pds-color-foreground-default same token, theme value
Shimmer, resting dim content at 58% of --pds-color-foreground-default same
Shimmer, peak --pds-color-foreground-default same

Expect to change

  • Type weight. The headlines and card titles are medium (500) set directly in the component CSS; the pds-heading-* classes force semibold with !important. Recommended: keep medium as designed, and port to a PDS heading style if one with that weight exists.
  • Card radius. --pds-border-radius-card (0.5rem), not Panel's --pds-border-radius-panel (0.75rem), to match the artifact exactly. Recommended: keep; use Panel only if consistency with Panel matters more.
  • Slot shape. cards is an array of { content, icon? }. A reviewer might prefer children (CardSequence with CardSequence.Card parts). Recommended: keep the array, since the component owns the line and the timing per index.
  • Required label props. workingLabel and completeLabel are required, for the screen-reader text. Recommended: keep.
  • @property and CSS masks. Needs current browsers. Where @property is missing the card settles without the fade. Recommended: accept.
  • Hardcoded timing. The choreography is fixed (3 s per card, 2 s tail, 2 s landing hold) and is not a prop. Recommended: keep until a flow needs another rhythm (L11: no knob with one right value).
  • Trailing full stop. The component draws a trailing "." of workingLabel in the brand color. Recommended: drop it if it feels too clever.

Target-version check

Against v2.0.0-beta.21 (the installed package and .pds-reference):

  • Icons used in the stories (building, folder, code, server, files, gear) are in the icon registry. The component itself imports no PDS component.
  • All tokens above exist in the package CSS, including --pds-color-badge-brand-background and -foreground (the same in both themes) and --pds-animation-duration-ai-shimmer.
  • No CardSequence or similar component exists in the package. npm run shipped did not report one.

Port notes

  • Would live in src/components/ in the loading indicators category folder (next to Spinner, Skeleton and ThinkingState), generator npm run generate:component.
  • Not yet matching v2: the local mergeClasses stand-in (the package does not export it; the port uses the real one); the style custom properties --card-start set per card; the story-only Demo helper and the Replay button (drop them).
  • Keep the card text in the slot as real text so it is read once.

Preview

npm run storybook, then Component Proposals/Loading Indicators/Card Sequence (stories above; the Usage page has Purpose, Usage, Accessibility, Footprint and Implementation). PR: https://github.com/pantheon-systems/pds-proposals/pull/51. Figma: none.