Navigation link
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 is a link element that is used as a child of the primary, secondary, subnav, and vertical navigation elements. Intrinsically, the Navigation Link is a list item and should not be used outside of navigation elements that define the parent list element.
| Slot Name | Summary | Description |
|---|---|---|
|
Use this slot when the |
||
|
The default slot should contain the link text when the |
| 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 |
|
|
| Method Name | Description |
|---|---|
|
|
| Token | Summary | Copy |
|---|---|---|
--rh-color-text-primary
|
|
|
--rh-color-interactive-primary-hover
|
|
|
--rh-color-gray-50
|
|
|
--rh-color-gray-40
|
|
|
--rh-border-width-md
|
|
|
--rh-color-interactive-primary-default
|
|
|
--rh-border-radius-default
|
|
Other libraries
To learn more about our other libraries, visit this page.
Feedback
To give feedback about anything on this page, contact us.