Skip to main content

Components

Link

Link is clickable text or graphics that take the user to other pages or documents.

children
Description

The content to display inside the link.

Type
any
asChild
Description

Change the default rendered element for the one passed as a child, merging their props and behavior.

Type
boolean
Default
false
NameTypeDefaultDescription
childrenany-

The content to display inside the link.

asChildbooleanfalse

Change the default rendered element for the one passed as a child, merging their props and behavior.

Usage

The component is an <a> element, and on MDN Web Docs you can read more about the anchor HTML tag (mozilla.org).

Examples

In text

With icon

Neutral color

HTML

Use the class name ds-link on an <a> element to apply the style of the Link component.

CSS variables and data attributes

CSS Variables
NameValue
--dsc-link-background--activevar(--ds-color-surface-tinted)
--dsc-link-color--activevar(--ds-color-text-default)
--dsc-link-color--hovervar(--ds-color-text-default)
--dsc-link-colorvar(--ds-color-text-subtle)
--dsc-link-color--visitedvar(--ds-link-color-visited)
--dsc-link-text-decoration-thickness--hover0.125em
--dsc-link-text-decoration-thickness0.0625em
--dsc-link-border-radiusvar(--ds-border-radius-md)

No relevant data attributes found.

Edit this page on github.com (opens in a new tab)