← All proposals

Agentic Split Button

A separate component, `AgenticSplitButton`, a copy of the PDS v2 Split Button, so the engineer's port is mostly a copy:

Extends a PDS componentOpen in Storybook

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

Handoff: Split Button, variant='agentic'

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

What and why

A split button for actions the agent does: a primary action grouped with a menu of more actions, with the AI gradient as the border around the whole control (the primary action and the caret together). It is the PDS Split Button plus variant='agentic' (added to 'primary' | 'secondary') and isAnimated (shimmer). Approved 2026-11-20 (reverses the 2026-10-21 "separate component" decision; see decisions.md).

  • Figma / Jira: none. Source: the designer's request and decisions in design review.
  • Context: context.md

Exploration and decisions

  • Extension (2026-11-20). The local SplitButton.tsx (renamed from AgenticSplitButton.tsx) is the package SplitButton plus the variant and the flag. primary and secondary behave as in the package.
  • One border around the control, not on each half. The wrapper (pds-split-button--secondary pds-split-button--agentic) paints the gradient on its border-box; the halves are a plain secondary Button and a plain MenuButton with their own borders removed.
  • Only the new CSS ships. agentic-split-button.css is cut to the part that differs from the package split-button.css. The verbatim copy moved to split-button-base.css, a stand-in that is not ported: the package CSS is in @layer pds-v2, and this repo's local Button copy is unlayered, so without the copy the halves lose their square inner corners and separator in Storybook.
  • Same height as an agentic Button. The wrapper's border adds two border widths, so the halves are that much shorter (--button-height overridden for s and m).
  • The separator between the halves keeps the secondary border color, not a gradient.
  • isAnimated shimmers the border (opt-in, false; off for reduced motion).
  • isLink branch: the package SplitButton renders a ButtonLink when the first item is a link. A story (Link Action) now covers it.

Full list: decisions.md.

API

All other SplitButton props are unchanged. Additions:

Prop Type Default Purpose
variant adds 'agentic' 'primary' The secondary look plus the AI gradient border around the whole control.
isAnimated boolean false Shimmers the gradient border. Only applies to variant='agentic'. Off for reduced motion.

Variants and states: sizes s and m; with icon; disabled; a link as the primary action. Stories (render <SplitButton variant='agentic'>): Default, With Icon, Link Action, Disabled, All Sizes.

Tokens used

From agentic-split-button.css as it is now:

  • --pds-animation-duration-ai-shimmer
  • --pds-border-width-default
  • --pds-color-button-secondary-background-default
  • --pds-color-surface-default
  • --pds-gradient-ai-active
  • --pds-spacing-button-height-m, --pds-spacing-button-height-s

The rest is the package split-button.css.

Impact

From impact.md: no existing variant is changed; the rules are scoped to .pds-split-button--agentic. No other proposal builds on it.

Reused vs net-new

  • Reused: the package SplitButton markup and CSS (the secondary rules), the package ButtonLink, Button and MenuButton (local stand-in copies here).
  • Net-new: variant='agentic', isAnimated, .pds-split-button--agentic, .pds-split-button--animated, two custom variables. See custom.md (no raw values).

Accessibility

  • Unchanged from the Split Button: two buttons (the primary action and "More actions"), with the MenuButton's menu semantics and keyboard behavior. See the Accessibility section of AgenticSplitButton.mdx.
  • The gradient border is decorative.
  • Not checked: no a11y panel run and no look at light or dark in this rewrite.

Decisions and open questions

Each has a recommendation.

  • Gradient on the divider between the halves? Recommendation: no, keep the plain separator.
  • Working state on the primary action (the Button's isWorking)? Recommendation: not now; add if a screen needs it.
  • A primary agentic version? Recommendation: no, as for the Button.

Extension or new component

An addition to SplitButton: a new variant value and one flag. primary and secondary and their package stories are untouched.

Footprint

Nothing draws outside the wrapper's box: the gradient is on the wrapper's border-box. The menu panel is the MenuButton's dropdown, positioned by Floating UI (optionally anchored to the whole control with anchorToFullButton), as for the other variants.

Dark mode and per-size values

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

Size Halves' --button-height Control height (with the 2 border widths)
s --pds-spacing-button-height-s minus 2 border widths --pds-spacing-button-height-s
m --pds-spacing-button-height-m minus 2 border widths --pds-spacing-button-height-m

Border width is --pds-border-width-default. The package secondary split button is 2 border widths taller than a Button; that is not changed for primary and secondary.

Expect to change

  • variant='agentic' on a component whose variants are only primary and secondary (L1). Recommendation: keep; it is the extension shape the toolkit used for Panel and SectionMessage.
  • isAnimated that only applies to one variant (L2). Recommendation: default false, as on Button and Panel.
  • Mixed halves: the halves render as secondary while the wrapper is agentic. Recommendation: keep, so the halves need no agentic code.

Target-version check

Checked against .pds-reference/src at v2.0.0-beta.21 (2026-11-20):

Item In the package at beta.21?
SplitButton variant='agentic' no (Extract<ButtonVariant, 'primary' | 'secondary'>)
SplitButton isAnimated no
.pds-split-button secondary CSS yes (the lines this proposal used to copy are the package's own)
MenuButton and Button variant='agentic' no (see their handoffs)

Port notes

  • Edit the package SplitButton in src/components/buttons/SplitButton: add 'agentic' to variant, isAnimated, the wrapper classes, and use secondary for the halves; add the CSS from agentic-split-button.css to split-button.css. Do not port split-button-base.css (it is the package CSS). No generator. Port Button and MenuButton (agentic) first only if the halves should show agentic; they do not, so they are not required.
  • The local SplitButton.tsx uses stand-in Button and MenuButton copies and omits the package's testId={null} on the MenuButton; do not port those differences.

Preview

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

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