Jump links
On this page
General usage
In general, use jump links as a sticky or persistent navigation to help users move through sections of content without scrolling.
Vertical vs. horizontal
There are two available orientations that offer several benefits and risks.
Orientation | Benefits | Risks |
---|---|---|
Vertical |
|
|
Horizontal |
|
|
Writing content
Title text
The title should always be included and should default to “Jump to section” if something else is not provided. Use sentence case only and limit title text to 25 characters max.
Layout
Placement
Vertical jump links are place on the left side of content by default and aligned to the top edge. However, in situations where there is already and element on the left side like a menu, jump links can be placed on the right side of content.
Mobile
On small screens, both vertical and horizontal jump links collapse into a disclosure which is always located above content. When the disclosure is expanded, jump links are displayed and any page content below is pushed down.
Behavior
Order of operations
When a page loads, both vertical and horizontal jump links are anchored to the top edge of content or a container before becoming sticky. There are a few things that can happen from here:
- The first section on top is highlighted with a thick red border
- When a user selects a jump link, they are moved down to their chosen section
- The new active section is highlighted
- When a user selects another jump link, they are moved up or down
- When a user scrolls, active sections are highlighted as they pass by
Nested jump links
Nested jump links are indented under the parent section. They are hidden by default and become visible when the parent section becomes active by a user clicking on it or scrolling to it. They can be individually selected, but only one level max is recommended.
Helpful tip
Only the vertical orientation can display nested jump links.
Scrolling on backgrounds
If jump links are scrolling on top of different background or surface colors, the jump links container needs to have a background color to avoid color contrast issues. If jump links are scrolling on top of a uniform color, no background is needed. Follow these specs as well:
- Use a background color that generally matches the color scheme of the rest of the page
- The border radius must use
--rh-border-radius-default
token - Padding on all sides must use the
--rh-space-lg
token
Responsive design
Vertical
Vertical jump links can occupy a specific amount of space like a number of grid columns. However, longer text means more line breaks.
Horizontal
Horizontal jump links span the entire page width. However, if the container is not wide enough to display everything, overflow buttons will appear.
Disclosure
To save space, both vertical and horizontal jump links collapse into a disclosure at specific screen sizes.
Learn more about the Disclosure element.
Orientation | Collapse into disclosure |
---|---|
Vertical | 991px and below |
Horizontal | 767px and below |
Best practices
No title
Write a custom title or uses the default which is “Jump to section”.
Do not hide the title or else it might be confusing to users what this element does.
Long headings
Write short headings so that short jump links are created.
Be aware that long headings will create even longer jump links.
Max number of jump links
Include a max of eight jump links or use nesting.
Don't overload jump links with too many parent section links.
Other libraries
To learn more about our other libraries, visit this page.
Feedback
To give feedback about anything on this page, contact us.