← All proposals

Icon Button

Starting point for an IconButton proposal.

Extends a PDS componentOpen in Storybook

proposals/IconButton/custom.md34 lines · View on GitHub

Custom and net-new: IconButton

Everything in this proposal that is not plain PDS v2. npm run check:tokens reads this file: each net-new class, custom CSS variable and raw value found in the code must appear here in backticks.

Net-new components

None.

Additions to existing PDS components

  • On .pds-icon-button: .pds-icon-button--agentic (the agentic variant), .pds-icon-button--primary (the filled variant, for Send) and .pds-icon-button--working (while isWorking) and .pds-icon-button--2xs (the 2xs size).

Net-new props

  • size='2xs': a new value on the existing size prop; a 24px box (--pds-spacing-xl) with a 14px icon, for dense rows. Class .pds-icon-button--2xs.
  • variant='agentic': a new value on the existing variant prop; the AI gradient as the border (always bordered).
  • variant='primary': a new value on the existing variant prop; filled like a primary Button.
  • isWorking: a spinner replaces the icon, and the button is disabled with aria-busy.

Custom CSS variables

  • --icon-button-background — set on .pds-icon-button
  • --icon-button-background-hover — set on .pds-icon-button
  • --icon-button-border — set on .pds-icon-button
  • --icon-button-border-hover — set on .pds-icon-button
  • --icon-button-fill — set on .pds-icon-button.pds-icon-button--agentic
  • --icon-button-foreground — set on .pds-icon-button
  • --icon-button-size — set on .pds-icon-button

Raw values kept on purpose

  • opacity: 40% on .pds-icon-button--primary:disabled (also the working state). The v2 disabled fade is 70% on the button and 30% on its content, written as raw percentages in v2's own icon-button.css; the primary variant uses one 40% fade of the whole button, as the Send button had it. There is no opacity token. The port can pick the toolkit's disabled opacity instead.
  • outline-offset: 1px on .pds-icon-button--primary:focus-visible. The focus ring sits 1px off the filled button so it stays visible against the fill. There is no outline-offset token.