feat: let toast actions render as links - #12
Open
anmolsinghbhatia wants to merge 1 commit into
Open
Conversation
`ToastData`'s `actions` and `primaryAction` take an optional `href` (and `target`), so an action that is a genuine navigation target renders as an `<a>` rather than a `<button>`. It keeps middle-click, cmd/ctrl-click, right-click -> "Copy link address" and the status-bar URL preview, and reaches the accessibility tree as a link. The action is still declared as data, so the closed API holds and the styling stays on-token. A link action renders the styled part directly instead of grafting Base UI's `Toast.Action` onto it: that part's `useButton` stamps `type="button"` or `role="button"` onto whatever it renders, either of which would announce the anchor as a button. It contributes no focus management to lose. `target="_blank"` derives its own `rel="noopener noreferrer"`.
codingwolf-at
requested changes
Sep 1, 2026
codingwolf-at
approved these changes
Sep 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
ToastData'sactionsandprimaryActionnow take an optionalhref(andtarget), so a toast action that is a genuine navigation target renders as an<a>rather than a<button>. It keeps middle-click, cmd/ctrl-click, right-click → "Copy link address" and the status-bar URL preview, and reaches the accessibility tree as a link. The action is still declared as data, so the closed API holds and the styling is unchanged — a link and a button action are visually identical.target="_blank"derives its ownrel="noopener noreferrer"; callers never pass arel.Type of Change
Screenshots
Screen.Recording.2026-09-01.at.7.45.56.PM.mov