← All proposals

Agentic Menu Button

A separate component, `AgenticMenuButton`, for a menu of actions the agent does:

Extends a PDS componentOpen in Storybook

proposals/AgenticMenuButton/HANDOFF.md98 lines · View on GitHub

Handoff: Menu Button, variant='agentic'

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

What and why

A menu of actions the agent does. It is variant='agentic' on the existing MenuButton: in label mode the trigger is the Button with variant='agentic' (the secondary look with the AI gradient border); with iconOnly it is an IconButton with variant='agentic'. Approved 2026-11-20 (reverses the 2026-10-21 "separate component" decision; see decisions.md).

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

Exploration and decisions

  • Extension, not a copy (2026-11-20). The 873-line copy (AgenticMenuButton.tsx) is deleted. MenuButton passes variant='agentic' to the Button (label mode) and to the IconButton (iconOnly, where it was hardcoded 'standard').
  • agentic is the one variant allowed with iconOnly. Every other value is still ignored in icon-only mode, as in the package. This is documented in the TSDoc.
  • Icon-only open state: a small CSS override (agentic-menu-button.css, imported by MenuButton) so the open state still shows a fill on top of the gradient border.
  • isSelected removed from the local MenuButton copy: it was an unused leftover from the retired Model Selector and is not part of this change.
  • Used by Labeled Divider: only as a story composition now (the divider no longer builds a selector itself).

Full list: decisions.md.

API

All other MenuButton props are unchanged. The one change:

Prop Type Default Purpose
variant adds 'agentic' 'primary' The trigger is the Button's agentic variant (label mode) or an IconButton variant='agentic' (iconOnly).

Variants and states: label and icon-only triggers; sizes xs, s, m; with tally and status dot (label mode); disabled; open. Stories (render <MenuButton variant='agentic'>): Default, Icon Only, With Tally, With Status Dot.

Tokens used

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

  • --pds-color-button-secondary-background-active (the icon-only open state)

The trigger's own tokens come from the Button and IconButton additions.

Impact

From impact.md: no existing variant is changed. One opt-in rule targets the agentic Icon Button's open state. Builds on Button (variant='agentic') and IconButton (variant='agentic'); LabeledDivider uses it in a story only.

Reused vs net-new

  • Reused: the whole MenuButton (markup, CSS, NavAccordion, mobile accordion).
  • Net-new: the agentic value of variant, and the icon-only open-state rule. See custom.md.

Accessibility

  • Unchanged from the Menu Button: aria-haspopup, aria-expanded, menu semantics, keyboard navigation and focus handling; the icon-only trigger has an accessible name from label. See the Accessibility section of AgenticMenuButton.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

  • Mobile accordion for the agentic menu? Recommendation: leave it as the MenuButton has it; isMobileAccordion is opt-in and off by default.
  • Other variant values with iconOnly. Recommendation: keep ignoring them; only agentic changes the icon-only trigger.

Extension or new component

An addition to MenuButton: a new variant value. The existing variants (primary, secondary, subtle, reverse-secondary, navbar) and their stories are untouched.

Footprint

Nothing draws outside the trigger's box (the gradient is on the border-box). The menu panel is the existing dropdown panel, positioned by Floating UI as for any MenuButton, so a parent that clips overflow behaves the same as for the other variants.

Dark mode and per-size values

No per-theme override. The one rule in agentic-menu-button.css is a fill variable that follows a theme-aware token. Sizes xs, s, m come from the Button and IconButton (see their handoffs). Not checked by eye in either theme.

Expect to change

  • variant='agentic' also switches the icon-only trigger (a position-like exception to "variant is ignored with iconOnly"). Recommendation: keep it; the alternative is a separate isAgentic flag, which the designer already moved away from.
  • Local-only changes: the isSelected removal is a clean-up of the stand-in copy, not for the port.

Target-version check

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

Item In the package at beta.21?
MenuButton variant='agentic' no ('primary' | 'secondary' | 'subtle' | 'reverse-secondary' | 'navbar')
IconButton variant='agentic' no (see the IconButton handoff)
Button variant='agentic' no (see the Button handoff)
isSelected on menu items no (removed from the local copy)

Port notes

  • Edit the package MenuButton: add 'agentic' to variant, pass it to the Button, and to the IconButton when iconOnly; add the open-state rule from agentic-menu-button.css to menu-button.css. Port Button and IconButton (agentic) first.
  • The local _base/MenuButton/ is a stand-in copy (see its README); do not port it.

Preview

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

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