Skip to content

feat(button): rework the button-family API#239

Merged
sriramveeraghanta merged 2 commits into
mainfrom
feat/button-family-api
Jul 24, 2026
Merged

feat(button): rework the button-family API#239
sriramveeraghanta merged 2 commits into
mainfrom
feat/button-family-api

Conversation

@sriramveeraghanta

Copy link
Copy Markdown
Member

What

Reworks the API of the whole button family — Button, IconButton, SplitButton, ButtonGroup/ButtonGroupButton, and AnchorButton (elements + components tiers):

  • prominence + tone → one variant axis: primary / secondary / tertiary / ghost / danger / danger-outline (danger was only ever definable as filled-primary and outlined-secondary, so they are now first-class variants; impossible pairs are unrepresentable)
  • magnitudesize (values unchanged: sm / md / lg / xl)
  • sizingfillType (values unchanged: hug / fill; Button only)
  • startIcon / endIcon → single icon prop + iconPosition ("start" default, "end" to trail). The loading spinner now takes the icon slot at the same position.
  • Explicit disabled prop (hard, non-focusable native disabled — previously only leaked through prop spreading; loading stays the soft-disabled focusable state)
  • type prop: "button" (default) / "submit" / "reset"

render is untouched, and all styling values are 1:1 — every variant maps to the exact class set it had before (disabled/aria palettes included).

Breaking change

This is a breaking API change; a minor changeset is included. Internals renamed accordingly: control-chrome.ts is a single flat variant cva axis (ControlChromePair / controlChromePair() removed), button-geometry.ts and link-chrome.ts axes renamed, and public types are now ButtonVariant / ButtonSize / ButtonFillType (same pattern for the other four components).

Sweep covers: all family stories, every consuming story in the package, patterns/, the docs site (~80 demos + component pages; button demos renamed prominences/tones/magnitudesvariants/sizes), and docs/integration.md examples.

Verification

Merge prominence + tone into a single variant axis (primary / secondary /
tertiary / ghost / danger / danger-outline), rename magnitude to size and
sizing to fillType, replace startIcon/endIcon with a single icon prop plus
iconPosition (start default; the loading spinner takes the same slot), and
add explicit disabled and type (button default) props.

Applies across the whole button family: Button, IconButton, SplitButton,
ButtonGroup, and AnchorButton — elements and components tiers, stories,
patterns, docs-site demos and pages, and the integration guide.
Copilot AI review requested due to automatic review settings July 24, 2026 14:30

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 24, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
propel-docs f915ed4 Jul 24 2026, 04:11 PM

Avatar tones are now always auto-derived (the tone prop and AVATAR_TONES
export were removed in #224), and BreadcrumbLink/BreadcrumbPage take a
label prop instead of children. Unbreaks docs check:types (22 errors) and
the three red CI checks.
Copilot AI review requested due to automatic review settings July 24, 2026 16:08

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

Copy link
Copy Markdown

📚 Storybook preview: https://pr-239-propel-storybook.vamsi-906.workers.dev

@sriramveeraghanta
sriramveeraghanta merged commit ed3b525 into main Jul 24, 2026
3 checks passed
@sriramveeraghanta
sriramveeraghanta deleted the feat/button-family-api branch July 24, 2026 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants