← All proposals

SpinnerSequence

A new component, SpinnerSequence, that composes the existing PDS v2 Spinner and Illustration (the Spinner is not changed).

Net-new componentOpen in Storybook

proposals/SpinnerSequence/HANDOFF.md158 lines · View on GitHub

Handoff: SpinnerSequence

Rewritten 2026-11-20 against v2.0.0-beta.21 to the lessons template. Facts below were checked against SpinnerSequence.tsx, spinner-sequence.css, SpinnerSequence.stories.tsx and the beta.21 source in the reference checkout. Nothing was checked by eye in a session (no screenshots): how it looks, and any accessibility result, is "not checked". The axe run recorded below is from 2026-11-03 and was not repeated.

What and why

A loading state for a wait of several seconds with stages (the NCX sign up flow: "Creating business account...", "Creating workspace...", then "Taking you to your business account"). It is a Spinner that walks through a list of steps, each with its own text, then ends on an illustration and a final text. It composes the existing PDS Spinner and Illustration; neither is changed. The team sets the steps (text, and optionally how long each shows), the final text and the illustration, and can run it on timers or drive it from the real work.

  • Figma: Spinner Sequence page in PDS-Proposals (pageUrl in figma.json; 5 Storybook captures, light only; sent 2026-11-03) and a real Figma component, Spinner Sequence (set 625:2582: State Loading/Complete, Label and Final label, with the library Spinner and Illustrations as exposed instances), plus an example flow. Jira: none. Source: the "Page 4 - Loading loop" artboard in the Claude Design project "Complete your profile".
  • Context: context.md
  • Priority: next, for the NCX sign up flow (docs/PRIORITY.md). Status: ready-for-dev (the designer's call, 2026-11-03). The position in the port order is in docs/PORT-ORDER.md (generated; it changes).

Exploration and decisions

  • New component, not Spinner props. The timers, the list of steps and the final state do not belong in a plain loading ring, and Spinner is used by Icon Button, Agentic Button and Event Log. So SpinnerSequence composes the unchanged Spinner and Illustration.
  • The ring is the current PDS Spinner, not the thicker ring in the Claude Design artboard. Default 5xl (64px); size is a prop.
  • The sequence stops at the end. The design loops its three screens as a demo; a real loading state ends. onComplete fires when the final state shows so the page can move on.
  • Timers or the real work. A timer is a guess, so activeStep turns the timers off and lets the page move the steps.
  • The illustration is the same box as the ring, bound to the size token (no magic number). The ring's edge is about 1px inside its box, so the illustration reads about 1px larger; accepted by the designer (2026-11-03).
  • Tried and not done: Spinner props for all of it; a Size property on the Figma component (the designer wants the size set on the nested Spinner and Illustration).

API

SpinnerSequenceProps extends ComponentPropsWithoutRef<'div'> without children. Props are alphabetical in the file. A style passed in is merged after the component's --sequence-size.

Prop Type Default Purpose
activeStep number none Current step when the real work decides (controlled). 0 is the first step; a number equal to or greater than the number of steps shows the final state. When set, the timers are off.
className string '' Additional class names.
defaultDuration number 2000 How long each step shows, in milliseconds, unless the step has its own duration. Ignored when activeStep is set.
finalLabel string required Text shown with the illustration once the last step is done.
illustration ReactNode none Your own illustration for the final state. Takes over from illustrationName. Drawn at the ring size, decorative.
illustrationName 'task' | PDSIllustration 'task' Which illustration to show in the final state. task is the proposal's own (not in the package yet).
onComplete () => void none Called when the final state shows: once per entry into it (see Expect to change).
size 's' | 'm' | 'l' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl' | '6xl' '5xl' Spinner size (the SpinnerSize type of the Spinner proposal). The illustration follows it.
steps { duration?: number; label: string }[] required The loading steps, in order. Any number. duration is that step's time in milliseconds; ignored when activeStep is set.

Behavior from the code: with steps empty, the final state shows at once. A negative activeStep shows an empty text (not handled). Two steps in a row with the same label do not re-announce or re-fade, because the paragraph is keyed on its text.

Variants and states: Default (timed, two steps, then final), own timing and steps, all sizes (final state), controlled by the work (activeStep), other illustration. Story-only helpers (L9, the port drops them): the key remount in Default, the "Next step" and "Start again" buttons and useState in ControlledByTheWork, finalLabel={size} in AllSizes (it prints the size name as the final text), the businessSteps sample data, and the stage tags and argTypes categories. The illustrationName control lists task, createEnvLive, createEnvMultidev and underConstruction; createEnvTest exists in the package and is not offered.

Tokens used

From spinner-sequence.css:

  • --pds-animation-duration-reveal
  • --pds-color-foreground-default
  • --pds-spacing-l

From SpinnerSequence.tsx (the size map, set inline as --sequence-size): --pds-spacing-s, --pds-spacing-m, --pds-spacing-l, --pds-spacing-xl, --pds-spacing-2xl, --pds-spacing-3xl, --pds-spacing-4xl, --pds-spacing-5xl, --pds-spacing-6xl.

The label uses the PDS pds-heading-m class (on a p, with its margin set to zero).

Custom variables (see custom.md): --sequence-fade, --sequence-size.

Impact

From impact.md (generated): nothing reaches existing components; the new classes are scoped to the pds-spinner-sequence block, and one rule sizes an illustration inside it (.pds-spinner-sequence__illustration > svg and > .pds-illustration, so it reaches only an illustration rendered in this block). No other proposal imports or uses it. It depends on the Spinner (an extension, ready; port it first) and on the PDS Illustration component.

Reused vs net-new

  • Reused: the proposal's Spinner (unchanged, default color), the PDS Illustration, and the pds-heading-m class.
  • Net-new: the component and its block, .pds-spinner-sequence (see custom.md); the task illustration (a local stand-in).
  • Proposal-only scaffolding (L9): the local mergeClasses, the local task data and the wrapper branch that renders it in SpinnerSequence.tsx, the NewIllustrationName type, and the sizeTokens map.

Accessibility

  • The text sits in one role='status' region (polite), in a paragraph keyed on its text so it is remounted on each change. The intent is that each new text and the final text are read out once; whether a given screen reader announces the first text on mount: not checked.
  • The stage (the Spinner and the illustration) is aria-hidden='true', so the Spinner's own hidden "Loading" label is not read, and nothing is announced twice. A custom illustration goes inside that stage, so an alt or role='img' on it would be hidden too: it is decorative by construction.
  • The fade between the spinner and the illustration, and the text fade, stop under prefers-reduced-motion; the timing still runs. The Spinner's own rotation stops under reduced motion too (a property of the Spinner).
  • The inactive layer is visibility: hidden after the fade, so it is not reachable by assistive technology.
  • Keyboard: nothing in the component is interactive; no focus.
  • axe-core (the engine behind the Storybook a11y panel), run 2026-11-03 per the earlier handoff, found no violations in: Default (loading step in dark; final state in light and dark), Own Timing And Steps (loading step, light), All Sizes (light), Controlled By The Work (dark) and Other Illustration (dark). Not every story in both themes, and not re-run since. Contrast of task in currentColor against the surfaces: not checked.

Decisions and open questions

Each has a recommendation (L10).

  • The task illustration is a local stand-in; the port adds task: { file: 'task.svg' } to the illustration registry (the registry has createEnvLive, createEnvMultidev, createEnvTest, underConstruction at beta.21, no task). The path comes from Illustration=TASK in the PDS Design Library v2 (node 5267:5707). The fill is currentColor here, so the Illustration team may recolor it with the illustration tokens. Recommendation: let the Illustration team own the SVG and its colors, and delete the local data and the wrapper branch.
  • Is 5xl (64px) right for the 120px artwork? Recommendation: keep 5xl as the default (the Claude Design artboard uses 64px and the designer accepted the 1px difference on 2026-11-03). Not checked by eye in light or dark.
  • A wide illustration (for example underConstruction) at 64px high. The CSS makes every illustration height: 100% of the stage, with width: auto and the package's max-width: 100%, so a wide illustration is capped to the stage width and drawn small. Recommendation: do not follow each illustration's shape; the sequence is built for a square mark like task. If a wide one is needed, pass the Illustration's own width or height props instead of the CSS rule.
  • Figma: the illustration does not follow the Spinner's size in the Figma component; resize it by hand after changing the Spinner Size. Steps and wait times are not Figma properties (a static component cannot count or time).
  • Not done: the Figma example's second step shows the first step's text (set it in Figma; the tool cannot write that font).

Extension or new component

A new component (L1). It is not an extension of an existing PDS component: it composes Spinner and Illustration and adds timers, a list of steps and a final state, none of which belongs on the Spinner (the proposal tried Spinner props and chose against it). Nearby components that were checked: ThinkingState (one agent label, optional timer; no steps and no final illustration) and VerticalEmptyState (isLoading swaps the illustration for a spinner; a different layout and no stages). Overlap with either was not tested beyond reading their props. The Spinner it composes is the Spinner proposal, so port Spinner first.

Footprint

From the CSS (not checked by eye):

  • The stage is one box of --sequence-size by --sequence-size; the spinner and the illustration are absolutely positioned inside it (inset: 0) and cross-fade, so nothing moves when the final state shows. Nothing is positioned outside the box and there are no negative insets or overflow changes.
  • The component is a column with a --pds-spacing-l gap, centered. Its width is its content: the stage width or the text, whichever is wider. A long text wraps inside the parent's width.
  • The text block has no reserved height. A step whose text wraps to a second line makes the component taller than a step with one line, so a parent that is not top-aligned, or a layout that centers it vertically, can shift when the text changes. A fixed minimum height on the text was not added.
  • A wide illustration is drawn smaller than the box (see the open question above); a tall one is capped by the box height. A custom illustration node is sized by the same rule only if it is an svg or .pds-illustration; any other node is not resized.
  • The illustration layer is visibility: hidden and opacity: 0 until complete, so a parent with overflow: hidden is not a problem, but a hidden layer still takes up the box.

Dark mode and per-size values

Single look for both themes in the proposal's CSS; no per-theme override. The tokens resolve per theme (--pds-color-foreground-default is dark text on light surfaces and light text on dark surfaces). The task stand-in follows it through currentColor. A PDS illustration uses its own theme-aware illustration colors (per the package changelog). Contrast in light and dark: not checked.

Stage box per size. The text style does not change with size.

Size Stage box (token, px) Gap to text Label text Fade
s --pds-spacing-s, 12 --pds-spacing-l, 20 pds-heading-m (single) --pds-animation-duration-reveal, 300ms
m --pds-spacing-m, 16 same same same
l --pds-spacing-l, 20 same same same
xl --pds-spacing-xl, 24 same same same
2xl --pds-spacing-2xl, 32 same same same
3xl --pds-spacing-3xl, 40 same same same
4xl --pds-spacing-4xl, 48 same same same
5xl --pds-spacing-5xl, 64 same same same
6xl --pds-spacing-6xl, 80 same same same

px at 16px per rem. The Spinner inside uses its own per-size values (see the Spinner handoff); the illustration is drawn at the stage height.

Expect to change

Each is a choice that may break a toolkit convention, with a recommended answer (L10).

  • Two props for one job: illustration and illustrationName (L2). Recommendation: keep illustrationName only, typed PDSIllustration once task is in the registry, and drop illustration. The shipped precedent, VerticalEmptyState, takes illustration: PDSIllustration (a name) plus a width, not a node. Keep a node prop only if the NCX flow needs an artwork that is not in the registry.
  • activeStep switches the component between timed and controlled (L2). One prop changes behavior and turns defaultDuration and steps[].duration off. Recommendation: keep it (it is the point of the design: the real work decides); document clearly that activeStep makes the timers inert. The engineer may split it into a controlled-only component and a timed wrapper.
  • defaultDuration and a per-step duration (L2, L11). Two ways to set a time. Recommendation: keep defaultDuration and drop the per-step duration unless a flow needs one step longer; then steps can be a plain list of strings. Label this a recommendation: the stories show per-step timing.
  • Required steps and finalLabel, and a default illustrationName of task (L2). There is no useful default text (the component holds no text), so they stay required in practice. Recommendation: keep them required in the type; if the engineer prefers optional props with a development warning, steps empty already shows the final state. Do not default illustrationName until task is in the registry; after that, keep task as the default.
  • size default 5xl (L11). The size is a real knob here (the stories show it), unlike a prop with one right value. Recommendation: keep size and the 5xl default.
  • sizeTokens repeats the Spinner's size map (L7, L9). Recommendation: export the Spinner's spinnerSizes and use it, or read the size from the Spinner's --spinner-size; do not keep two copies.
  • The CSS rule that sizes the illustration. The Illustration already has height and width props. Recommendation: pass height from the size and drop .pds-spinner-sequence__illustration > svg for a PDS illustration.
  • onComplete fires once per entry into the final state. The code resets when the sequence leaves the final state (activeStep goes back), so it can fire again on the next completion. The Usage text and the old handoff said "once"; the code does this. Recommendation: keep the code, document it as "each time the final state shows".
  • The paragraph keyed on its text. The key remounts the paragraph so the fade replays and a screen reader may announce it. Recommendation: keep it, and test with a screen reader; the engineer may use aria-live and aria-atomic on the region instead.
  • A negative or non-integer activeStep. Not handled. Recommendation: clamp it to 0 or warn in development.
  • Stand-ins and story helpers (L9): the local mergeClasses, the local task data and the wrapper branch, NewIllustrationName; the AllSizes story's finalLabel={size} and the ControlledByTheWork buttons. All are dropped in the port.
  • Screen-reader text (L3): none is hardcoded or nested; the spoken text is steps[].label and finalLabel, both top-level and translatable. The Spinner's own "Loading" label is hidden by the stage's aria-hidden.

Target-version check

Checked against .pds-reference at v2.0.0-beta.21, the installed package and CHANGELOG.mdx:

  • The package has Illustration and PDSIllustration (in components/media/Illustration/), with name, alt (default decorative), height and width. Already in beta.21 (added in an earlier beta, per the changelog).
  • Illustration names at beta.21: createEnvLive, createEnvMultidev, createEnvTest, underConstruction. No task (the old handoff said "beta.14 has four and no task"; the claim is still true at beta.21, the list is the same four). task is new.
  • SpinnerSequence, .pds-spinner-sequence and its parts: not in the package. New.
  • pds-heading-m, --pds-animation-duration-reveal (300ms) and the spacing tokens: already in the package.
  • The Spinner used here is the proposal's (../Spinner/Spinner), which carries the agentic additions; SpinnerSequence uses it at the default color only, so it needs only the package Spinner.
  • Not verified: no loading-state-guidance rule was read against this pattern (the package has loading-indicators/loading-state-guidance.mdx).

Port notes

  • New component. Put it next to the Spinner in pds-toolkit-react under src/components/loading-indicators/SpinnerSequence/ (generator: npm run generate:component; group directories are lowercase, no barrel files).
  • Replace the local mergeClasses stand-in with v2's (@libs/components/utils), and the local task illustration data and the wrapper branch in SpinnerSequence.tsx with the registry entry and the real Illustration.
  • Share or export the Spinner's size map instead of repeating sizeTokens.
  • Copy spinner-sequence.css; add the v2-new tag and categorized argTypes to the stories; keep the stories for each variant and the all-sizes case.
  • Resolve the points under Expect to change before porting.

Preview

npm run storybook, story Component Proposals/Spinner Sequence. Figma: Spinner Sequence, page Spinner Sequence.