Handoff: IconButton (agentic and primary variants, working, 2xs)
Rewritten 2026-11-20 against v2.0.0-beta.21 to the lessons template.
What and why
Three independent additions to the v2 IconButton, so each can ship alone (see "Three parts" below):
variant='agentic': the AI gradient as the border, for an action the agent does.variant='primary'+isWorking+ thestopicon: the Send button of a composer (filled like a primary Button, a spinner while working, a stop icon to stop a response).size='2xs': a 24px box for dense rows (Agent Tree tool icons).
Everything else is the v2 IconButton, so the port is a diff against src/components/buttons/IconButton. The separate SendButton proposal was removed on 2026-10-21; Send is a primary icon button.
- Figma: PDS Design Library branch
skill-test(awaiting review): Icon Button set gainsAgentic=No/Yes. Jira: none. - Context:
context.md
Exploration and decisions
variant='agentic'(2026-10-21). An extension of the Icon Button, like Send. It replaced anisAgenticboolean (superseded; the old bullets indecisions.mdare folded under a note).- Send is a primary icon button (2026-10-21). Its three states are made from props:
iconName='paperPlane'(send),isWorking(spinner) andiconName='stop'(stop). 2xs(2026-11-18). 24px is the smallest box that meets the WCAG 2.2 minimum target size.- Spinner from the package (2026-11-20).
isWorkinguses the package Spinner withcolor='currentColor'; the local Spinner proposal is no longer a dependency. - Technique (agentic): a transparent border with the gradient on the border-box and the fill on the padding-box, over an opaque surface layer. The fill is a custom property (
--icon-button-fill) so hover, active and pressed can swap it. Pressed uses the secondary active background instead of v2's border-color fill, which a gradient cannot provide.
API
All other props are unchanged from v2. The three additions, one per part:
| Prop | Type | Default | Part | Purpose |
|---|---|---|---|---|
variant |
adds 'agentic' |
'standard' |
1 | The AI gradient border (--pds-gradient-ai-active). Always bordered; hasBorder does not apply. |
variant |
adds 'primary' |
'standard' |
2 | Filled like a primary Button, for the main action of a toolbar (Send). hasBorder does not apply. |
isWorking |
boolean |
false |
2 | A spinner replaces the icon; the button is disabled and has aria-busy. The caller changes ariaLabel with the state. |
size |
adds '2xs' |
's' |
3 | A 24px box (--pds-spacing-xl) with a 14px (s) icon. The s Spinner is the smallest, the tooltip offset is 4. |
Variants and states: stories are Default (agentic), Sizes, With Border, Pressed, Primary All States and Primary Send. Every v2 variant, size and state is unchanged.
Part 1: variant='agentic'
- Port: add
'agentic'to thevariantunion and the.pds-icon-button--agenticrules (rest, hover, active, pressed) inicon-button.css. - Needs only
--pds-gradient-ai-activeand--pds-color-surface-default. Depends on no other proposal. - Stories: Default, Sizes (the Agentic row), Pressed.
Part 2: variant='primary' + isWorking + stop
- Port: add
'primary'tovariant, theisWorkingprop,.pds-icon-button--primaryand--working.stopandpaperPlaneare the icons:paperPlaneis in the package;stopis not (see Target-version check and the Icon handoff: addfaStopas a registry entry). isWorkinguses the packageSpinner(color='currentColor'), so it needs no other proposal. Port Icon first only forstop.- Stories: Primary All States, Primary Send.
Part 3: size='2xs'
- Port: add
'2xs'toIconButtonSize(the package type is'xs' | 's' | 'm') and.pds-icon-button--2xs, plus the icon, spinner and tooltip-offset switch cases. - Stories: Sizes.
Tokens used
New to this proposal: --pds-gradient-ai-active (part 1). From the CSS as it is now:
--pds-animation-transition-button--pds-border-radius-input--pds-border-width-default,--pds-border-width-outline--pds-color-button-primary-background-active,-default,-hover,--pds-color-button-primary-foreground,--pds-elevation-button-primary-active(part 2)--pds-color-button-critical-secondary-*,--pds-color-button-reverse-secondary-*,--pds-color-button-secondary-*(background, border and foreground states), and the matching--pds-elevation-button-*-secondary-active--pds-color-interactive-focus,--pds-color-interactive-reverse-focus--pds-color-surface-default--pds-elevation-icon-button-pressed--pds-spacing-button-height-m,-s,-xs, and--pds-spacing-xl(the2xsbox)
Impact
From impact.md: no existing PDS component is reached. The additions are .pds-icon-button--agentic, --primary, --working and --2xs, which only apply where those classes are added. Proposals that build on it: MenuButton (variant='agentic', icon-only trigger), through it LabeledDivider; Composer, Chat Attachment, Chat Panel, Feedback Bar and Agent Tree use it directly; the Chat with an agent recipe uses variant='primary'. Port IconButton before them (see docs/PORT-ORDER.md).
Reused vs net-new
- Reused: the whole v2
IconButton; the packageIcon,TooltipandSpinner. - Net-new: the
isWorkingprop, theagenticandprimaryvariant values and the2xssize,.pds-icon-button--agentic,--primary,--workingand--2xs, and seven--icon-button-*variables (seecustom.md).
Accessibility
- Unchanged from v2: native
button, requiredariaLabel, tooltip,aria-pressed, visible focus ring. isWorkingsetsaria-busyand disables the button. The spinner is decorative and there is no working-state text of its own: the caller must updateariaLabel("Send message", "Sending message", "Stop response"). This is documented inIconButton.mdx.- The gradient border is decorative.
- Not checked: no a11y panel or contrast run was made in this rewrite, in light or dark. The primary hover and active states in dark are not checked either.
Decisions and open questions
Each has a recommendation.
- Should
criticalorreverseget the gradient border too? Recommendation: no, it is not needed by any screen. - Does Send need the gradient border or an agentic treatment on
primary? Recommendation: no; shipprimarywithout it. - A voice (waveform) state for an empty field. Never built. Recommendation: leave it out until a screen needs it.
- Is the
sspinner too big in a 24px box (2xs)? Not looked at. Recommendation: keeps; the Spinner has no smaller size. - Strict-null fixes in the local copy (for example
icon2Namedefaults toundefined, notnull) change no behavior. v2 is not strict, this repo is. Recommendation: do not port them.
Extension or new component
An extension of the existing IconButton: new values on variant and size and one new prop, isWorking. The standard, reverse and critical variants and their stories are untouched. The three parts are separable, so any can land on its own.
Footprint
Nothing draws outside the button's box. The agentic gradient is painted on the border-box inside the same width and height as the other variants. The primary focus ring uses outline-offset: 1px, so it draws 1px outside the box, as v2's outline already does at its default offset; a parent with overflow: hidden can clip it. At 2xs the box is 24px, so a row needs at least 24px of height and the tooltip offset is 4px (v2 sizes xs, s and m use 6, 8 and 11).
Dark mode and per-size values
No per-theme override in icon-button.css: every color is a theme-aware token, so light and dark come from the tokens. Not checked by eye in either theme.
| Size | Box | Token | Icon | Spinner (isWorking) |
Tooltip offset |
|---|---|---|---|---|---|
2xs (new) |
24px | --pds-spacing-xl |
s, 14px |
s |
4 |
xs |
28px | --pds-spacing-button-height-xs |
m, 16px |
s |
6 |
s (default) |
32px | --pds-spacing-button-height-s |
m, 16px |
m |
8 |
m |
40px | --pds-spacing-button-height-m |
xl, 20px |
l |
11 |
Expect to change
variant='primary'andvariant='agentic'onIconButton. Recommendation: agree, they extend the existingvariantprop (L1). If the engineer prefers,primarycan be the secondary-only change and Send a recipe.isWorking(a boolean that disables the button). Recommendation: agree; it mirrorsisLoadingonButton. Name itisLoadingif the toolkit prefers one name for both. The engineer may rename it.- No
workingLabelprop (L3). Recommendation: do not add one;ariaLabelis already a top-level string and the caller changes it with the state. Documented in the Accessibility section. hasBorderis ignored onagenticandprimarywithout a dev warning. Recommendation: state "ignored" in the TSDoc, or add a[IconButton]dev warning asButtondoes.size='2xs'is one right value for dense rows (L11, a knob with one use). Recommendation: keep it; it is a size, not a free setting.- Raw
opacity: 40%andoutline-offset: 1px(seecustom.md). Recommendation: use the toolkit's disabled opacity.
Target-version check
Checked against .pds-reference/src at v2.0.0-beta.21 (2026-11-20):
| Item | In the package at beta.21? |
|---|---|
variant='agentic', 'primary' |
no (variant is 'standard' | 'reverse' | 'critical') |
isWorking |
no |
size='2xs' |
no (IconButtonSize is 'xs' | 's' | 'm'); 2xs in the changelog is the layout gap scale |
paperPlane icon |
yes |
stop icon |
no (see the Icon handoff) |
Spinner with color string |
yes (color?: string, --spinner-color); no color='agentic' |
Agentic option on Button, IconButton |
no (the agentic Button is a separate handoff) |
Port notes
- Edit
src/components/buttons/IconButtonin place. Do not use the generator. Each part is its own change (see "Three parts"). - Swap the local
mergeClassesfor the real one.Iconhere is the local wrapper; use the packageIcononcestopis in the registry. - Part 2 needs the
stopicon from the Icon handoff; it does not need the Spinner proposal (the package Spinner is enough).
Preview
npm run storybook, then Component Proposals/Buttons/Icon Button.
Figma: https://www.figma.com/design/AMGWJbraJoi2PKWnxo29Ah/PDS-Proposals?node-id=291-6900