Skip to content

feat(app-ui): render Button and IconButton as links with href - #891

Merged
cakeinpanic merged 2 commits into
mainfrom
feat/link-icon-button-and-link-button-story
Nov 2, 2026
Merged

cakeinpanic merged 2 commits into
mainfrom
feat/link-icon-button-and-link-button-story

Conversation

@exromany

@exromany exromany commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Button and IconButton accept href and render an <a> through LinkProvider; without it they stay a <button>.

  • Props are a union on href: loading/type are button-only; disabled on a link → aria-disabled, styled like :disabled.
  • LinkButton kept as a deprecated alias of <Button href>.
  • Behavior change: absolute http(s) / protocol-relative URLs now open in a new tab (target=_blank, rel=noopener noreferrer) for every app-ui link unless target is passed; NavLink's external arrow follows the same rule. external is deprecated but still honored (external={false} opts out).
  • Link examples moved into the Button/IconButton stories.

With `href`, Button and IconButton render an <a> through LinkProvider (linkProps, disabled -> aria-disabled); without it they stay a <button>. Props are a union on href: loading/type are button-only. LinkButton is kept as a deprecated alias.

Absolute http(s) and protocol-relative URLs now open in a new tab (target=_blank, rel=noopener noreferrer) for every app-ui link unless `target` is passed; NavLink's external arrow follows the same rule. `external` is deprecated but still honored (`false` opts out).

IconButton and surface styles treat [aria-disabled='true'] like :disabled and drop text-decoration, so the link renders identically. Link stories move into the Button/IconButton stories; the LinkProvider demo router is extracted to .storybook/components/DemoRouter.
- share strict button/link prop halves via ActionElement; AsButton/AsLink
  props now include own props, drop casts and OwnProps exports
- inline IconButtonContent, move joinAriaLabel to utils
- inherit deprecated `external` from AnchorProps, drop dead plumbing
- merge identical outline/ghost hover rules, trim LinkProvider JSDoc
- tests: reuse RouterLink, drop Anchor-covered cases, void type checks
@exromany
exromany requested a review from a team as a code owner November 2, 2026 08:41
@preview-stands

preview-stands Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Preview stand status

Stand was demolished

@cakeinpanic
cakeinpanic merged commit 4b4fe13 into main Nov 2, 2026
10 checks passed
@cakeinpanic
cakeinpanic deleted the feat/link-icon-button-and-link-button-story branch November 2, 2026 15:30
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.

2 participants