CSC Design System v4.0.1
VueFlavour Vue React Angular TypeScript
Flavour Vue React Angular TypeScript
PrimaryCSC UI Colors Primary Secondary AccentCustom Colors Red Orange Green Blue Purple Pink
CSC UI Colors Primary Secondary AccentCustom Colors Red Orange Green Blue Purple Pink
Guides Getting started Customization Data visualization Migration guide Componentsc-accordionc-alertc-autocompletec-badgec-breadcrumbc-buttonc-button-groupc-cardc-checkboxc-color-pickerc-csc-logoc-data-tablec-date-pickerc-dividerc-file-uploadc-iconc-icon-buttonc-linkc-listc-loaderc-login-buttonsc-login-cardc-mainc-menuc-messagec-modalc-navigation-buttonc-number-fieldc-otp-inputc-pagec-paginationc-popoverc-progress-barc-progress-circlec-radio-groupc-selectc-side-navigationc-sliderc-spinnerc-statusc-stepsc-switchc-tablec-tabsc-tagsc-text-fieldc-time-pickerc-toastsc-toolbarc-tooltipc-tree-select

<c-link>

A text link to another page or resource: a native `<a>` in the link colour, with an optional underline.

Usage

Put the link text in the default slot and set href. target says where the link opens, as on a native <a>: the same tab unless set, _blank for a new one.

<c-link href="/docs/billing">Read the billing guide</c-link>

When to use

  • Navigation in running text, or a list of links.
  • For an action, use c-button (appearance="text" looks the lightest); for a link that looks like a button, use c-button with href.

Underline

underline underlines the text. Underline links inside running text, so they are not told apart from the text around them by colour alone.

Accessibility

The link is a native <a>: focus, Enter, middle-click and open-in-new-tab come from the platform. Its accessible name is its text, so make the text say where it leads ("Read the billing guide", not "click here"). Without href the <a> has no destination: it is neither focusable nor announced as a link, so do not use c-link for actions.

ARIA attributes (aria-label, aria-current, …) and the link attributes rel, download, hreflang, ping, referrerpolicy and type set on the c-link element are forwarded to the inner <a>.

Customization

::part(root) is the <a>. It paints the link role, with the link-subtle fill on hover and a focus ring in the link colour; override the tokens to re-theme.

c-link::part(root) {
  font-weight: 400;
}

Examples

API reference

A text link to another page or resource: a native `<a>` in the link colour, with an optional underline.

PropertyAttributeTypeDefaultDescription
hrefhrefstring'' URL the link leads to. Without it the link has no destination: it is neither focusable nor announced as a link.
targettargetstring'' Where the `href` opens, as on a native `<a>`: the same tab unless set — `_blank` for a new one.
underlineunderlinebooleanfalse Underline the text. Underline links inside running text, so colour is not the only thing telling them apart.
SlotDescription
defaultThe link text

Style from outside with c-link::part(name) — parts are the library's only styling customization API.

PartDescription
rootThe native `<a>` element carrying the link styling