Skip to content

fix: make Button polymorphic with distinct loading/disabled a11y states (#55) - #174

Open
rafaio1 wants to merge 1 commit into
MergeFi:mainfrom
rafaio1:fix/55-button-polymorphic-a11y
Open

fix: make Button polymorphic with distinct loading/disabled a11y states (#55)#174
rafaio1 wants to merge 1 commit into
MergeFi:mainfrom
rafaio1:fix/55-button-polymorphic-a11y

Conversation

@rafaio1

@rafaio1 rafaio1 commented Aug 20, 2026

Copy link
Copy Markdown

Fixes #55.

  • Rewrite Button as a polymorphic component supporting as prop (e.g. as="a" or as={Link}) so navigation CTAs render correct anchor semantics instead of imperative onClick redirects.
  • Add distinct loading state using aria-busy="true" and a visual spinner overlay that keeps the element in the tab order, separate from native disabled which removes it from the accessibility tree entirely.
  • Forward ref correctly for all variants and element types.
  • Preserve all existing visual variants (primary, secondary, ghost, outline) and sizes (sm, md, lg).
  • TypeScript compiles cleanly with npx tsc --noEmit.

@vercel

vercel Bot commented Aug 20, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the chonilius' projects Team on Vercel.

A member of the Team first needs to authorize it.

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.

Make Button a correct polymorphic, accessible primitive (link vs button semantics)

1 participant