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.
Slots
2
| Slot Name | Summary | Description |
|---|---|---|
|
Use this slot when the |
||
|
The default slot should contain the link text 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
7
| Token | Description | Copy |
|---|---|---|
--rh-color-text-primary
|
|
|
--rh-color-interactive-primary-hover
|
|
|
--rh-color-gray-50
|
Subtle icon |
|
--rh-color-gray-40
|
Subtle icon (hover state) |
|
--rh-border-width-md
|
2px border width: Example: Alert |
|
--rh-color-interactive-primary-default
|
|
|
--rh-border-radius-default
|
3px border radius; Example: Card |
|
Other libraries
To learn more about our other libraries, visit this page.
Feedback
To give feedback about anything on this page, contact us.