Link Button
Text-styled control for link and navigation actions, rendered as a real anchor or a button.
Attributes
| Name | Type | Default | Description |
|---|---|---|---|
href | string | undefined | undefined | Destination URL. When set (and the element is not disabled) the control renders as an anchor element. |
aria-label | string | null | null | Accessible name forwarded to the native link or button. |
target | string | undefined | undefined | Browsing context for the link, forwarded to the anchor. Ignored when `external` is set. |
rel | string | undefined | undefined | Link relationship, forwarded to the anchor. Takes precedence over the value implied by `external`. |
download | string | undefined | undefined | Prompts to download the destination instead of navigating; forwarded to the anchor. |
external | boolean | false | Opens the link in a new tab (`target="_blank" rel="noopener noreferrer"`) and shows an arrow-up-right suffix icon by default. |
disabled | boolean | false | Disables the control: it renders as a disabled button element (even with `href`), ignores clicks and is dimmed. |
selected | boolean | false | Marks the current or active item (`aria-current="page"` on links, `aria-pressed` on buttons). |
CSS custom properties
Grouped by the element and state they target. Click a group to collapse it; click a name to copy it.
| Name | Type | Default | Description |
|---|---|---|---|
--c2-link-button__container--gap | pixel | 6px | |
--c2-link-button__container--padding-top | padding | 4px | |
--c2-link-button__container--padding-right | padding | 4px | |
--c2-link-button__container--padding-bottom | padding | 4px | |
--c2-link-button__container--padding-left | padding | 4px | |
--c2-link-button__container--border-radius | border-radius | 4px | |
--c2-link-button__container--background-color | color | — | |
--c2-link-button__container--color | color | currentColor | |
--c2-link-button__container--font-size | pixel | 14px | |
--c2-link-button__container--font-weight | font-weight | 500 | |
--c2-link-button__container--text-decoration | text-decoration | none | |
--c2-link-button__container--text-decoration-color | color | rgb(2, 101, 220) | |
--c2-link-button__container--text-underline-offset | pixel | 4px | |
--c2-link-button__container__hover--color | color | rgb(2, 101, 220) | |
--c2-link-button__container__hover--background-color | color | — | |
--c2-link-button__container__hover--text-decoration | text-decoration | underline | |
--c2-link-button__container__hover--text-decoration-color | color | — | |
--c2-link-button__container__focus--outline | outline | 2px solid rgba(2, 101, 220, 0.4) | |
--c2-link-button__container__focus--outline-offset | pixel | 2px | |
--c2-link-button__container__selected--color | color | rgb(2, 101, 220) | |
--c2-link-button__container__selected--background-color | color | — | |
--c2-link-button__container__selected--font-weight | font-weight | 600 | |
--c2-link-button__container__selected--text-decoration | text-decoration | — | |
--c2-link-button__container__disabled--opacity | opacity | 0.38 | |
--c2-link-button__icon--size | pixel | 16px | |
--c2-link-button__icon--color | color | — | |