← 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/AgenticSplitButton.mdx35 lines · View on GitHub
import { Canvas, Controls, Meta, Title } from '@storybook/addon-docs/blocks';

import * as AgenticSplitButtonStories from './AgenticSplitButton.stories';

<Meta of={AgenticSplitButtonStories} name='Usage' />

<Title />

## Purpose

Split Button, `variant='agentic'`: a split button for actions the agent does, a primary action grouped with a menu of more actions. It is the PDS Split Button with the AI gradient as the border around the whole control, to match the agentic Button and Menu Button.

## Usage

- It is a value of the Split Button's `variant` prop, not a separate component. `actionItems` is an array: the first item is the primary action (a callback, or a link with `isLink`) and the rest fill the menu. Every other Split Button prop is the same, plus `isAnimated`.
- The agentic look is the secondary treatment, as on the agentic Button. The gradient is one border around the primary action and the caret together, not on each half. The control keeps the height of a standalone Button.
- `isAnimated` shimmers the border. It is off by default, only applies to this variant, and stops for reduced motion.
- Use it where the main action is something the agent does, with the other ways to run it in the menu. Use the regular Split Button for everything else.

## Accessibility

- It is two native buttons: the primary action (or a link) and the "More actions" menu trigger. Set `moreActionsLabel` to a translated name for the trigger, since it has only an icon.
- The menu trigger has `aria-haspopup` and `aria-expanded`; the menu uses the Menu Button's semantics and keyboard behavior, unchanged.
- The gradient border is decorative.
- Not checked: no a11y panel run in this rewrite, and light and dark were not looked at.

## Implementation

See the table below for the available props.

<hr />

<Canvas of={AgenticSplitButtonStories.Default} />
<Controls of={AgenticSplitButtonStories.Default} />