← All proposals

Agentic Button

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

Extends a PDS componentOpen in Storybook

proposals/AgenticButton/AgenticButton.mdx36 lines · View on GitHub
import { Canvas, Controls, Meta, Title } from '@storybook/addon-docs/blocks';

import * as AgenticButtonStories from './AgenticButton.stories';

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

<Title />

## Purpose

Button, `variant='agentic'`: a button for an action the agent does. It is the secondary Button look with the AI gradient as its border, and a gradient working spinner.

## Usage

- It is a value of the Button's `variant` prop, not a separate component. It takes every Button prop (`label`, `size`, `displayType`, `iconName`, `isLoading`, `isWorking`, `disableWhenWorking`, `isFullWidth`, `tally`, `statusDot`, `tooltipText`, `disabled` and the rest), plus `isAnimated`.
- The look is always the secondary treatment: the surface fill with the gradient border. There is no primary (dark) version.
- `isAnimated` shimmers the border. It is off by default, and only applies to this variant. It stops for reduced motion.
- Use it for the call to action of an agent's suggestion, or the trigger of a menu of agent actions (`MenuButton` with `variant='agentic'`). Use the regular Button for everything else.

## Accessibility

- It is a native `button`: Tab to focus, Enter or Space to activate. Focus shows the Button's visible focus ring.
- The label is the accessible name. Set `ariaLabel` only when the visible label is not enough.
- The gradient border and the spinner are decorative. While `isWorking`, the button is disabled (unless `disableWhenWorking` is `false`) and the spinner is hidden from assistive technology (its wrapper is `aria-hidden`), so say what is happening in the label or a live region on the screen. `isLoading` disables the button and hides its content behind the pulse; set `tooltipText` to say why.
- The state is never conveyed by color alone.
- Not checked: no a11y panel or contrast run on the gradient border or the working states in light and dark.

## Implementation

See the table below for the available props.

<hr />

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