Link is used to navigate to another page or resource.
The link component comes in 4 sizes: xs
, sm
, md
and lg
. The size is determined by the context around the link
The link can be used in brand
, neutral
and inverted
colors. The default color is the brand
color.
The bold style is usually used when the link is not part of a flowing text.
Links embedded in the text are always underlined. For separate links, if the interactivity is clear based on the context - for example in the header or footer - the underline can be omitted.
The icon can be placed both before and after the link. Basically the link component can wrap any content.
The link component can be used in NextJs with the Link
component.
<Link
href="/design-system-dev/frameworks/react"
passHref
legacyBehavior>
<dap-ds-link>Link</dap-ds-link>
</Link>
import { DapDSLink } from 'dap-design-system/dist/dds'
import { DapDSLinkReact } from 'dap-design-system/dist/react'
Property | Type | Default | Description |
---|---|---|---|
size | 'lg' , 'md' , 'sm' , 'xs' | The size of the link | |
variant | 'neutral' , 'brand' , 'inverted' , 'warning' | 'brand' | The theme of the link |
target | '_blank' , '_self' , '_parent' , '_top' | '_self' | The target of the link. |
bold | boolean | Bold link style | |
noUnderline | boolean | Removes underline style | |
href | string | '#' | The href / URL of the link |
disabled | boolean | false | Disabled state of the link |
rel | string | 'noreferrer noopener' | The rel of the link |
download | boolean | false | The download attribute of the link |
Name | Description |
---|---|
(default) | The text of the link. |
Event Name | Description | Type |
---|---|---|
dds-click | Emitted when the link is clicked. | {event: Event } |
Part Name | Description |
---|---|
base | The main link container. |
text | The text of the link. |
Property Name | Description |
---|---|
--dds-link-color | The color of the link text |
--dds-link-hover-color | The color of the link text on hover |
--dds-link-active-color | The color of the link text when active |
--dds-link-visited-color | The color of the visited link text |
--dds-link-font-size | The font size of the link text |
--dds-link-line-height | The line height of the link text |
--dds-link-font-weight | The font weight of the link text |
--dds-link-text-decoration | The text decoration of the link |
--dds-link-neutral-color | The color of the neutral variant link |
--dds-link-neutral-hover-color | The hover color of the neutral variant link |
--dds-link-neutral-active-color | The active color of the neutral variant link |
--dds-link-neutral-visited-color | The visited color of the neutral variant link |
--dds-link-brand-color | The color of the brand variant link |
--dds-link-brand-hover-color | The hover color of the brand variant link |
--dds-link-brand-active-color | The active color of the brand variant link |
--dds-link-brand-visited-color | The visited color of the brand variant link |
--dds-link-inverted-color | The color of the inverted variant link |
--dds-link-inverted-hover-color | The hover color of the inverted variant link |
--dds-link-inverted-active-color | The active color of the inverted variant link |
--dds-link-inverted-visited-color | The visited color of the inverted variant link |
--dds-link-warning-color | The color of the warning variant link |
--dds-link-warning-hover-color | The hover color of the warning variant link |
--dds-link-warning-active-color | The active color of the warning variant link |
--dds-link-warning-visited-color | The visited color of the warning variant link |
--dds-link-disabled-color | The color of the disabled link |
--dds-link-disabled-hover-color | The hover color of the disabled link |
--dds-link-disabled-active-color | The active color of the disabled link |
--dds-link-disabled-visited-color | The visited color of the disabled link |
--dds-link-lg-font-size | The font size of the large link |
--dds-link-lg-line-height | The line height of the large link |
--dds-link-md-font-size | The font size of the medium link |
--dds-link-md-line-height | The line height of the medium link |
--dds-link-sm-font-size | The font size of the small link |
--dds-link-sm-line-height | The line height of the small link |
--dds-link-xs-font-size | The font size of the extra small link |
--dds-link-xs-line-height | The line height of the extra small link |
--dds-link-normal-font-weight | The font weight of the normal link |
--dds-link-bold-font-weight | The font weight of the bold link |
--dds-link-no-underline-text-decoration | The text decoration when underline is removed |