Navigation link
>
Since v4.0.0
Importing
Add rh-navigation-link to your page with this import statement:
<script type="module">
import '@rhds/elements/rh-navigation-link/rh-navigation-link.js';
</script>
Copy to Clipboard
Copied!
Wrap lines
Overflow lines
To learn more about installing RHDS elements on your site using an import map read our getting started docs.
Usage
<rh-navigation-link href="#link">Link</rh-navigation-link>
<rh-navigation-link><a href="#link">Slotted a href Link</a></rh-navigation-link>
<rh-navigation-link icon="auto-light-dark-mode" icon-set="ui" href="#ai">Containers</rh-navigation-link>
<script type="module">
import '@rhds/elements/rh-navigation-link/rh-navigation-link.js';
</script>
Copy to Clipboard
Copied!
Wrap lines
Overflow lines
rh-navigation-link
Navigation Link provides a link for use within Red Hat navigation
components. It must be a child of elements like rh-subnav or
rh-navigation-primary that provide the parent list context. Authors
should set href or slot an <a> element directly; authors must not
slot a <button>. When current-page is set, aria-current="page" is
applied so screen readers announce the active page. Uses
delegatesFocus so Tab focus passes to the anchor.
Theming
This element uses Red Hat design system theming and can be used in themable contexts.
Slots
2
| Slot Name | Summary | Description |
|---|---|---|
icon, only rendered when |
Use instead of the |
|
Link content |
When the |
Attributes
4
| Attribute | DOM Property | Description | Type | Default |
|---|---|---|---|---|
|
|
icon |
Shorthand for the |
|
|
|
|
iconSet |
Icon set for the |
|
|
|
|
href |
The URL to navigate to when the link is clicked |
|
|
|
|
currentPage |
Indicates that this link refers to the current page for accessibility; used with the |
|
|
Methods
1
| Method Name | Description |
|---|---|
|
|
Events
0
None
CSS Shadow Parts
0
None
CSS Custom Properties
0
None
Design Tokens
4
| Token | Description | Copy |
|---|---|---|
--rh-color-text-primary
|
Link text color |
|
--rh-color-interactive-primary-default
|
Focus outline color |
|
--rh-border-width-md
|
Focus outline width Applies a 2px border width to at least 1 side of a container. It should be used to add emphasis or visual separation beyond a 1px border. Recommended for elements needing extra thickness like Alert or Progress stepper. It must be used to ensure hover, focus, and active states are discernible by more than color alone per WCAG. Applying to all 4 sides at once is optional. |
|
--rh-border-radius-default
|
Focus border radius Applies a 3px border radius to at least 1 corner of a container. This shall be the default for all containers needing rounded corners. It should be used to soften a container's visual footprint. Recommended for elements with subtle rounded corners like Button, Card, or Dialog. It must be applied to all 4 corners of a container at once. |
|
Other libraries
To learn more about our other libraries, visit this page.
Feedback
To give feedback about anything on this page, contact us.