Skip to main content
Link
@coinbase/cds-web@8.56.1
A pressable Text component.
import { Link } from '@coinbase/cds-web/typography/Link'
Related components

Link renders a pressable Text element as an anchor (<a>) by default. It inherits parent text styles and supports the same font and color props as Text.

Basics

By default, Link inherits the text styles of its parent. Pass an href to set the destination URL.

Loading...

Underline

Use the underline prop to add a text decoration underline to the link. This is particularly important for inline links within body text to meet WCAG 2.0 accessibility requirements.

Loading...

Underline with different fonts

The underline works across all font styles.

Loading...

Underline within a paragraph

When a link appears inline within body text, always use underline so users can distinguish the link from surrounding text without relying on color alone.

Loading...

Styling

Font

To style a Link, either wrap it in the desired Text component with the appropriate as prop for semantic HTML, or use the font prop directly on the Link.

Wrapping in Text

Loading...

Using the font prop

If you need to style a link without wrapping it in a semantically appropriate text element, use the font prop directly.

Loading...

Color

Override the default link color using the color prop with any CDS foreground token.

Loading...

openInNewWindow

Set openInNewWindow to open the link in a new browser tab.

Loading...

rel

Use the rel prop to set the relationship between the current document and the linked resource.

Loading...

Accessibility

Accessibility tip

WCAG 2.0 has 2 requirements for body text links that are not underlined by default:


The link text must have a 3:1 contrast ratio from the surrounding non-link text. The link must present a "non-color designator" (typically the introduction of the underline) on both mouse hover and keyboard focus. These two requirements help ensure that all users can differentiate links from non-link text, even if they have low vision, color deficiency, or have overridden page colors.

Use the underline prop on inline links within body text to ensure they are distinguishable without relying on color alone.

Loading...

Is this page useful?

Coinbase Design is an open-source, adaptable system of guidelines, components, and tools that aid the best practices of user interface design for crypto products.