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.
| || ||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.|| || |
| || ||Forces URL to open in a new browser tab. Used together with URL prop.|| || |
| || ||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.|| || |
| || ||The currently active language. This setting changes the external link accessible label to match the chosen language.|| || |
| || ||Theme of the button.|| || |
| || ||A destination to link to, rendered in the href attribute of a link.|| || |
setFocus(options?: FocusOptions) => Promise<void> #
Sets focus on the specified
duet-link. Use this method instead of the global
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 #
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.
- You can use
accessibleLabelproperty to add an 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.
externalproperty for links that open into a new browser window. Using this property the component makes sure that this behaviour is communicated correctly to users of assistive technology as well.
- Make sure to pass the correct language to the component when using the above funtionality (fi, sv or en).
Follow these practical tutorials to learn how to build simple page layouts using Duet’s CSS Framework, Web Components and other features:
Using CLI ToolsTutorials
Creating Custom PatternsTutorials
Server Side RenderingTutorials
Usage With MarkdownTutorials
If you experience any issues while using a component, please head over to the Support page for more guidelines and help.