Skip to content

Section Nav

A grouped list of links that turns into a scrolling row on small screens.

General

Your workspace's name, address and language.

Installation

  1. Add the registryOnce per project
  2. Add section-nav

Usage

Give SectionNav an aria-label and set active on the current page's item. Below the lg breakpoint the list becomes a scrolling row, so place it above the content on small screens. The active item scrolls into view, and the edges fade wherever there's more to scroll. To keep one layout at every width, set orientation. In a column, a label too long for the nav ends in an ellipsis rather than widening the nav.

Screen readers announce the active item as the current page. For links to sections of one page, pass aria-current="location" along with active.

To use your router's link, pass it to render on SectionNavItem, as in render={<Link to="/settings/profile" />}.

Composition

Examples

Without groups

Put SectionNavItems directly in SectionNav for a short list.

Orientation

orientation is responsive by default: a row below lg and a column from lg up. Set it to horizontal to keep the scrolling row at every width, as in a bar of a page's sections, or to vertical to keep the column, as in a menu drawer on a phone.

Scrolling

Give SectionNav a height to scroll a long list in the sidebar. It's a Scroll Area, so it fades at the edges and shows a scrollbar on hover.

Props

Base UI's styling (opens in a new tab) and composition (opens in a new tab) guides say more about className, style and render.

SectionNav

SectionNavGroup

SectionNavItem