Skip to content
Zuno UI
Explore components
EXPLORE
Actions
Forms
Layout
Navigation
Data display
Feedback
Overlays
RESOURCES
Components/PageNavigation

PageNavigation

An on-this-page table of contents with anchor links and the active section, without a router.

Overview

Deploy any branch to a preview URL, then promote it to production when it is ready.

Setup

Connect the repository and choose the framework preset; the build command is filled in for you.

Environment

Add the variables each environment needs. Production values are never exposed to previews.

Deploy

Push to the branch. The first build runs automatically and later pushes create new previews.

Installation

Run it from the root of a project already set up with zunoui init.

npx zunoui@latest add page-navigation

Dependencies

What add page-navigation installs alongside the component. The CLI skips any you already have in a compatible version.

ZUNO registry

  • @zuno/utils

Examples

1 examples · 1 component
page-navigation

Overview

Deploy any branch to a preview URL, then promote it to production when it is ready.

Setup

Connect the repository and choose the framework preset; the build command is filled in for you.

Environment

Add the variables each environment needs. Production values are never exposed to previews.

Deploy

Push to the branch. The first build runs automatically and later pushes create new previews.

Beside an article

Scroll the article: the active link follows the section you are reading.

API reference

Configured through items: it renders the nav, the links and the active state; other props reach the nav element.

PropTypeDefault
items

One entry per section, in page order. id is the element id it links to; level 3 indents a subsection.

{ id; label; level? }[]—
offset

Pixels from the top at which a section counts as active, usually the height of your page header.

number96
title

Visible heading above the links; pass null to hide it.

ReactNode"On this page"
aria-label

Names the navigation landmark.

string"On this page"

States

The states that apply to this component and their visual treatment.

StateTreatment
RestMuted links with a hairline on the start side.
ActiveThe current section's link in the text color with a solid line.
Hover / focusText color on hover; a visible outline on keyboard focus.

Accessibility

A labelled nav landmark with plain anchor links: it works before hydration, without a router, and Back returns to the previous section.

The link of the section being read carries aria-current="location", so screen readers announce it as the current one.

Give each target heading scroll-margin-top equal to your header (scroll-mt-24) so a jump doesn't hide it under the header.

Smooth scrolling is your page's choice; if you add it, turn it off under prefers-reduced-motion.

It tracks the window scroll. For a section inside its own scrolling panel, use the panel's links directly.