Jump links
On this page
Importing
Add rh-jump-links to your page with this import statement:
<script type="module">
import '@rhds/elements/rh-jump-links/rh-jump-links.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
<div id="jump-links-demo-container">
<aside>
<h2 id="sections">Sections</h2>
<rh-jump-links aria-labelledby="sections">
<rh-jump-link href="#section-1">Section 1</rh-jump-link>
<rh-jump-link href="#section-2">Section 2</rh-jump-link>
<rh-jump-link href="#section-3">Section 3</rh-jump-link>
<rh-jump-link href="#section-4">Section 4</rh-jump-link>
<rh-jump-link href="#section-5">Section 5</rh-jump-link>
</rh-jump-links>
</aside>
<p>Lorem ipsum dolor sit amet consectetur, adipisicing elit. Impedit itaque veniam animi iure corporis quibusdam error, necessitatibus inventore fugiat, minus natus eaque provident eius facilis.
Dolorem qui tenetur quaerat facere!</p>
</div>
<script type="module">
import '@rhds/elements/rh-jump-links/rh-jump-links.js';
</script>
<style>
#jump-links-demo-container {
display: grid;
grid-template-columns: auto 1fr;
gap: var(--rh-space-2xl, 32px);
aside {
h2 {
font-weight: var(--rh-font-weight-heading-medium);
font-family: var(--rh-font-family-body-text);
font-size: var(--rh-font-size-body-text-md);
line-height: var(--rh-line-height-body-text, 1.5);
margin-block-end: var(--rh-space-lg);
}
}
}
</style>
Copy to Clipboard
Copied!
Wrap lines
Overflow lines
rh-jump-links
Persistent in-page navigation for jumping to content sections.
Renders a role="navigation" landmark with aria-label from
accessible-label (required per WCAG 1.3.6 when multiple nav
landmarks exist). Supports vertical and horizontal orientations
with ScrollSpy auto-highlighting. Avoid nesting more than one
level deep.
Theming
This element uses Red Hat design system theming and can be used in themable contexts.
Slots
1
| Slot Name | Summary | Description |
|---|---|---|
[default]
|
navigation link items and nested lists (default slot) |
Contains |
Attributes
2
| Attribute | DOM Property | Description | Type | Default |
|---|---|---|---|---|
orientation
|
orientation |
Controls the layout direction of jump link items.
Usage guidelines
|
|
|
accessible-label
|
accessibleLabel |
Accessible name for the navigation landmark. Provides an Usage guidelines
Accessibility
|
|
|
Methods
2
| Method Name | Description |
|---|---|
firstUpdated()
|
|
orientationChanged()
|
Events
1
| Event Name | Description |
|---|---|
toggle
|
Fired when the |
CSS Shadow Parts
0
None
CSS Custom Properties
0
None
Design Tokens
8
| Token | Description | Copy |
|---|---|---|
--rh-length-4xs
|
Jump links border width 1px length token |
|
--rh-space-3xl
|
Jump link horizontal margin 48px spacer |
|
--rh-border-width-sm
|
Horizontal top border width Horizontal bottom border width 1px border width; Example: Secondary CTA or Button |
|
--rh-color-border-subtle
|
Jump links border color Horizontal top border color Horizontal bottom border color |
|
--rh-space-lg
|
Jump link horizontal spacing 16px spacer |
|
--rh-color-gray-40
|
Disabled scroll button text color in light mode Subtle icon (hover state) |
|
--rh-color-gray-50
|
Disabled scroll button text color in dark mode Subtle icon |
|
--rh-color-text-primary
|
Scroll button hover text color |
|
rh-jump-link
An individual navigation link within <rh-jump-links> that scrolls the
page to a target section. Renders as role="listitem" with an internal
anchor. When active, sets aria-current="location" for screen readers.
Tab moves focus to the link; Enter or click scrolls to the href
target. Must be a child of <rh-jump-links> or <rh-jump-links-list>.
Theming
This element uses Red Hat design system theming and can be used in themable contexts.
Slots
1
| Slot Name | Summary | Description |
|---|---|---|
[default]
|
link label text (default slot) |
Text content for this jump link. Serves as the accessible
name for the internal anchor element, so it should match
or closely reflect the target section heading (per WCAG
2.4.6 Headings and Labels). Keep text concise. |
Attributes
2
| Attribute | DOM Property | Description | Type | Default |
|---|---|---|---|---|
active
|
active |
Whether this link represents the currently visible section. When true, a bold border and |
|
|
href
|
href |
The URL fragment (e.g. |
|
|
Methods
0
None
Events
0
None
CSS Shadow Parts
0
None
CSS Custom Properties
1
| CSS Property | Description | Default |
|---|---|---|
--rh-jump-link-max-width |
Vertical link max width override |
calc(var(--rh-length-md, 8px) * 40)
|
Design Tokens
10
| Token | Description | Copy |
|---|---|---|
--rh-color-interactive-secondary-default
|
Jump link text color |
|
--rh-space-md
|
Jump link vertical spacing 8px spacer |
|
--rh-length-md
|
8px length token |
|
--rh-space-lg
|
Jump link vertical inline-end padding Jump link inner spacing 16px spacer |
|
--rh-color-interactive-primary-default
|
Focus ring color |
|
--rh-border-radius-default
|
Jump link corner rounding 3px border radius; Example: Card |
|
--rh-color-text-primary
|
Jump link hover text color Jump link focus text color Jump link active text color |
|
--rh-color-brand-red
|
Jump link active border color |
|
--rh-border-width-lg
|
Vertical active border width Horizontal active border width 3px border width: Example: Expanded Accordion panel |
|
--rh-color-border-status-neutral
|
Jump link hover/focus border color Vertical active border color Horizontal active border color |
|
rh-jump-links-list
Provides a nested, expandable group for organizing related
<rh-jump-link> elements within <rh-jump-links>. Put the link that
labels this group in slot="parent". In vertical orientation, child
links indent beneath the parent; in horizontal orientation the
group is hidden. Sets aria-current="location" and
role="listitem" on itself for screen readers. Avoid deeply
nesting multiple levels.
Theming
This element uses Red Hat design system theming and can be used in themable contexts.
Slots
2
| Slot Name | Summary | Description |
|---|---|---|
parent
|
parent link for this nested group (parent slot) |
A single |
[default]
|
child jump links (default slot) |
One or more |
Attributes
1
| Attribute | DOM Property | Description | Type | Default |
|---|---|---|---|---|
active
|
active |
Whether any child link in this group is the active section. When true, the parent border highlights and child list expands (vertical only). Defaults to false. |
|
|
Methods
0
None
Events
0
None
CSS Shadow Parts
0
None
CSS Custom Properties
0
None
Design Tokens
5
| Token | Description | Copy |
|---|---|---|
--rh-length-4xs
|
List border width 1px length token |
|
--rh-color-border-subtle
|
List border color |
|
--rh-space-lg
|
Jump link end spacing Nested link inline-start padding 16px spacer |
|
--rh-length-xs
|
Vertical active indicator width Horizontal active indicator width 4px length token |
|
--rh-color-brand-red
|
Vertical active indicator color Horizontal active indicator color |
|
Other libraries
To learn more about our other libraries, visit this page.
Feedback
To give feedback about anything on this page, contact us.