Skip to main content

Link Ready

Links are used in content paragraphs to create pathways from one page to another. If you need a link with semi bold font-weight and/or icon, please use Button component instead.

Examples #

Properties #

Property Attribute Description Type Default
accessibleLabel accessible-label Adds accessible label for the link that is only shown for screen readers. Typically, this label text replaces the visible text on the link for users who use assistive technology. string undefined
accessibleLabelExternal accessible-label-external Adds accessible label for tooltip that is shown in external link (url & external have both been set) string getLocaleString(this.accessibleLabelExternalDefaults)
accessibleLabelExternalDefaults accessible-label-external-default Defaults for accessibleLabelExternal DuetLangObject | string DuetStringsExternalDefaults
external external Forces URL to open in a new browser tab. Used together with URL prop. boolean false
icon icon Icon to display on the left side of the ink text (only with "block" variation) string undefined
iconColor icon-color Color of the icon to display (only with "block" variation) string "currentColor"
iconResponsive icon-responsive Whether the icon changes its size responsively (only with "block" variation) boolean false
identifier identifier Adds a unique identifier for the link. Please note that with this particular component this id is added inside Shadow DOM. If you need an id on the html element, use regular id attribute instead. string undefined
language language [DEPRECATED] this is now handled via the html lang tag, and is no longer used - kept to avoid breaking changes and ease unit testing

The currently active language. This setting changes the external link accessible label to match the chosen language.
"en" | "fi" | "sv" getLanguage()
padding padding Controls the padding of the component (only with "block" variation) "auto" | "none" "auto"
tabToLink tab-to-link Initially visually hidden link, which is shown on focus. boolean false
theme theme Theme of the button. "" | "default" | "turva" ""
url url A destination to link to, rendered in the href attribute of a link. string "#"
variation variation Style variation of the link. "block" | "default" "default"

Methods #

setFocus(options?: FocusOptions) => Promise<void> #

Sets focus on the specified duet-link. Use this method instead of the global
link.focus().

Parameters #

Name Type Description
options FocusOptions

Returns #

Type: Promise<void>

Shadow Parts #

Part Description
"block-chevron" piercing selector for styling the block chevron
"duet-link" piercing selector for styling the link
"duet-link-content" piercing selector for styling the link content wrapper

Usage #

This section includes guidelines for designers and developers about the usage of this component in different contexts.

When to use #

  • For navigation where the link appears within or following a sentence. Like this link here.
  • When you need to link to another page.

When not to use #

  • For interface actions that aren’t links to other views in the app. Use button instead.
  • When you need to provide a call-to-action for the user. Use button instead.
  • For form submit, cancel, edit, save and opening a modal. Use button instead.

Accessibility #

This component has been validated to meet the WCAG 2.1 AA accessibility guidelines. You can find additional information regarding accessibility of this component below.


Integration

For integration, event and theming guidelines, please see Using Components. This documentation explains how to implement and use Duet’s components across different technologies like Angular, React or Vanilla JavaScript.

Integration guidelines


Tutorials

Follow these practical tutorials to learn how to build simple page layouts using Duet’s CSS Framework, Web Components and other features:

Tutorials

Building Layouts

Tutorials

Using CLI Tools

Tutorials

Creating Custom Patterns

Tutorials

Server Side Rendering

Tutorials

Sharing Prototypes

Tutorials

Usage With Markdown


Troubleshooting

If you experience any issues while using a component, please head over to the Support page for more guidelines and help.