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 (
pageUrlinfigma.json; 5 Storybook captures, light only; sent 2026-11-03) and a real Figma component,Spinner Sequence(set625:2582:StateLoading/Complete,LabelandFinal 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 indocs/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
SpinnerSequencecomposes the unchangedSpinnerandIllustration. - The ring is the current PDS Spinner, not the thicker ring in the Claude Design artboard. Default
5xl(64px);sizeis a prop. - The sequence stops at the end. The design loops its three screens as a demo; a real loading state ends.
onCompletefires when the final state shows so the page can move on. - Timers or the real work. A timer is a guess, so
activeStepturns 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
Sizeproperty 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 PDSIllustration, and thepds-heading-mclass. - Net-new: the component and its block,
.pds-spinner-sequence(seecustom.md); thetaskillustration (a local stand-in). - Proposal-only scaffolding (L9): the local
mergeClasses, the localtaskdata and the wrapper branch that renders it inSpinnerSequence.tsx, theNewIllustrationNametype, and thesizeTokensmap.
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 customillustrationgoes inside that stage, so analtorrole='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: hiddenafter 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
taskincurrentColoragainst the surfaces: not checked.
Decisions and open questions
Each has a recommendation (L10).
- The
taskillustration is a local stand-in; the port addstask: { file: 'task.svg' }to the illustration registry (the registry hascreateEnvLive,createEnvMultidev,createEnvTest,underConstructionat beta.21, notask). The path comes fromIllustration=TASKin the PDS Design Library v2 (node 5267:5707). The fill iscurrentColorhere, 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
5xlas 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 illustrationheight: 100%of the stage, withwidth: autoand the package'smax-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 liketask. If a wide one is needed, pass the Illustration's ownwidthorheightprops 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-sizeby--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-lgap, 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
illustrationnode is sized by the same rule only if it is ansvgor.pds-illustration; any other node is not resized. - The illustration layer is
visibility: hiddenandopacity: 0until complete, so a parent withoverflow: hiddenis 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:
illustrationandillustrationName(L2). Recommendation: keepillustrationNameonly, typedPDSIllustrationoncetaskis in the registry, and dropillustration. The shipped precedent,VerticalEmptyState, takesillustration: 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. activeStepswitches the component between timed and controlled (L2). One prop changes behavior and turnsdefaultDurationandsteps[].durationoff. Recommendation: keep it (it is the point of the design: the real work decides); document clearly thatactiveStepmakes the timers inert. The engineer may split it into a controlled-only component and a timed wrapper.defaultDurationand a per-stepduration(L2, L11). Two ways to set a time. Recommendation: keepdefaultDurationand drop the per-stepdurationunless a flow needs one step longer; thenstepscan be a plain list of strings. Label this a recommendation: the stories show per-step timing.- Required
stepsandfinalLabel, and a defaultillustrationNameoftask(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,stepsempty already shows the final state. Do not defaultillustrationNameuntiltaskis in the registry; after that, keeptaskas the default. sizedefault5xl(L11). The size is a real knob here (the stories show it), unlike a prop with one right value. Recommendation: keepsizeand the5xldefault.sizeTokensrepeats the Spinner's size map (L7, L9). Recommendation: export the Spinner'sspinnerSizesand 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
heightandwidthprops. Recommendation: passheightfrom the size and drop.pds-spinner-sequence__illustration > svgfor a PDS illustration. onCompletefires once per entry into the final state. The code resets when the sequence leaves the final state (activeStepgoes 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
keyremounts 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 usearia-liveandaria-atomicon the region instead. - A negative or non-integer
activeStep. Not handled. Recommendation: clamp it to0or warn in development. - Stand-ins and story helpers (L9): the local
mergeClasses, the localtaskdata and the wrapper branch,NewIllustrationName; theAllSizesstory'sfinalLabel={size}and theControlledByTheWorkbuttons. All are dropped in the port. - Screen-reader text (L3): none is hardcoded or nested; the spoken text is
steps[].labelandfinalLabel, both top-level and translatable. The Spinner's own "Loading" label is hidden by the stage'saria-hidden.
Target-version check
Checked against .pds-reference at v2.0.0-beta.21, the installed package and CHANGELOG.mdx:
- The package has
IllustrationandPDSIllustration(incomponents/media/Illustration/), withname,alt(default decorative),heightandwidth. Already in beta.21 (added in an earlier beta, per the changelog). - Illustration names at beta.21:
createEnvLive,createEnvMultidev,createEnvTest,underConstruction. Notask(the old handoff said "beta.14 has four and notask"; the claim is still true at beta.21, the list is the same four).taskis new. SpinnerSequence,.pds-spinner-sequenceand 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-guidancerule was read against this pattern (the package hasloading-indicators/loading-state-guidance.mdx).
Port notes
- New component. Put it next to the Spinner in
pds-toolkit-reactundersrc/components/loading-indicators/SpinnerSequence/(generator:npm run generate:component; group directories are lowercase, no barrel files). - Replace the local
mergeClassesstand-in with v2's (@libs/components/utils), and the localtaskillustration data and the wrapper branch inSpinnerSequence.tsxwith the registry entry and the realIllustration. - Share or export the Spinner's size map instead of repeating
sizeTokens. - Copy
spinner-sequence.css; add thev2-newtag 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.