← All proposals

Agentic Button

A separate component, `AgenticButton`, for an action the agent does:

Extends a PDS componentOpen in Storybook

proposals/AgenticButton/HANDOFF.md117 lines · View on GitHub

Handoff: Button, variant='agentic'

Rewritten 2026-11-20 against v2.0.0-beta.21 to the lessons template. The proposal folder is still AgenticButton and the story title is still "Agentic Button"; the code is now an addition to Button, not a separate component.

What and why

A button for an action the agent does: the secondary Button look with the AI gradient as its border and the gradient working spinner. It is variant='agentic' on the existing Button, plus an isAnimated prop (shimmer). The designer approved folding it into Button on 2026-11-20, reversing the 2026-10-21 "separate component" decision (see decisions.md). There is one look, the secondary treatment, not a primary one.

  • Figma / Jira: none. Source: the designer's agentic button design. The Figma page of this proposal still shows the old separate component.
  • Context: context.md

Exploration and decisions

  • Extension, not a fork (2026-11-20). Button gets the agentic value. Markup, sizes, states and the isLoading / isWorking logic are the Button's own. The old 289-line copy (AgenticButton.tsx) is deleted.
  • Border technique. --pds-gradient-ai-active is a gradient, so it cannot go in border-color. The border is transparent, the gradient paints the border-box, and the secondary fill sits on the padding-box over an opaque --pds-color-surface-default layer so the translucent secondary fill does not show the gradient through.
  • Working spinner. isWorking with the agentic variant renders the Spinner with color='agentic' (the gradient). isLoading clears the gradient (background-image: none) so the pulse shows cleanly.
  • isAnimated shimmers the border (the animated agentic Panel's loop; off for reduced motion). Opt-in, false by default; only applies to the agentic variant. The stories turn it on.
  • isSplitButton dropped from the agentic code path (nothing used it). Button keeps its own isSplitButton as in the package.

Full list: decisions.md.

API

All other Button props are unchanged. Additions:

Prop Type Default Purpose
variant adds 'agentic' 'primary' The secondary look plus the AI gradient border. tally and statusDot are allowed on it.
isAnimated boolean false Shimmers the gradient border. Only applies to variant='agentic'. Off for reduced motion.

Variants and states: all four sizes; default, disabled, loading, working (with disableWhenWorking), with icon, tally and status dot. Stories (all render <Button variant='agentic'>): Default, With Icon, With Tally, With Status Dot, Loading State, Working State, Working State Interactive, All States, All Sizes. The other variants and their stories are untouched.

Tokens used

From the CSS as it is now (agentic-button.css):

  • --pds-animation-duration-ai-shimmer
  • --pds-color-surface-default
  • --pds-gradient-ai-active

The rest is the Button's own.

Impact

From impact.md: no existing variant is changed; everything is scoped to .pds-button--agentic. Other proposals that use it: MenuButton (variant='agentic' trigger), SplitButton (separate handoff; its halves are plain secondary buttons), the Panel Approval Report (<Button variant='agentic'>), and through them LabeledDivider.

Reused vs net-new

  • Reused: the whole Button; Icon, Tally, Tooltip; the Spinner proposal's agentic color.
  • Net-new: the agentic value of variant, the isAnimated prop, .pds-button--agentic, .pds-button--animated. See custom.md (no raw values).

Accessibility

  • Unchanged from the Button: a native button, visible focus ring, ariaLabel, loading and working states.
  • The gradient border is decorative; the label carries the meaning (the spinner wrapper is aria-hidden, so the screen says what is working). See the Accessibility section of AgenticButton.mdx.
  • Not checked: no a11y panel run, no contrast measurement and no look at light or dark in this rewrite.

Decisions and open questions

Each has a recommendation.

  • Should there be a filled (primary) agentic button? Recommendation: not now; no screen needs it.
  • Name of the value. Recommendation: agentic, like Panel's agentic-* values and SectionMessage's type='agentic'.

Extension or new component

An addition to Button: a new variant value and one new flag. The human variants and their stories are untouched, except that the one base-CSS rule .pds-button--loading.pds-pulse { background-image: none } that this proposal used to need in button.css now lives in agentic-button.css, scoped to the agentic class (so button.css is the package's again on that point).

Footprint

Nothing draws outside the button's box: the gradient is on the border-box, inside the same width and height as the secondary Button. A parent cannot clip anything. With isAnimated, the gradient layer is twice the button's width inside the background and slides; it does not paint outside the box.

Dark mode and per-size values

No per-theme override in agentic-button.css. The fill and surface tokens are theme-aware; --pds-gradient-ai-active is defined once (in the light token file only), so the gradient is the same in both themes. Not checked by eye in either theme.

Size Icon Working spinner Tally size
xs xs s xs
s m m xs
m m m s
l xl l m

These are the Button's existing switch cases; agentic adds none. Heights are the Button's.

Expect to change

  • A variant value instead of a separate component (L1). Recommendation: this is already the recommended shape.
  • isAnimated as a flag on Button that only does something on one variant (L2, L11). Recommendation: keep it default false; if the toolkit prefers, make shimmer part of agentic always, or name it as Panel's isAnimated. Panel already ships isAnimated (default off).
  • Spinner color='agentic' is a magic string on a prop typed string in the package. Recommendation: land the Spinner proposal's agentic value first, or have Button pass an agentic class instead.
  • tally and statusDot allowed on agentic. Recommendation: keep, as on secondary.
  • Proposal story title says "Agentic Button"; once ported the stories belong under Button.

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' on Button no (ButtonVariant has ten values, none agentic)
isAnimated on Button no
pds-button__leading span and CSS yes (Button.tsx leading slot; button.css lines 47 and 59). The earlier note to add it was wrong and is removed
Spinner color='agentic' no (color?: string); comes from the Spinner proposal
--pds-gradient-ai-active, --pds-animation-duration-ai-shimmer yes (design tokens)

Port notes

  • Edit src/components/buttons/Button: add 'agentic' to ButtonVariant (src/libs/types/custom-types.tsx) and to the tally and statusDot allow-lists, add isAnimated, the classes pds-button--secondary pds-button--agentic (and pds-button--animated), the Spinner color, and the CSS block from agentic-button.css. No generator.
  • Port the Spinner proposal (color='agentic') first.
  • The local _base/Button is only a stand-in copy of the package Button (with utils.tsx stand-ins); do not port it. Its CSS imports ../../AgenticButton/agentic-button.css; in the port the block goes into button.css.

Preview

npm run storybook, then Component Proposals/Buttons/Agentic Button.

Figma: https://www.figma.com/design/AMGWJbraJoi2PKWnxo29Ah/PDS-Proposals?node-id=436-1232