Scroll Spy Tabs

Pro

Sticky tabs that track the sections of one long page. The indicator follows as you scroll and tapping a tab jumps to its section, in underline, pill, numbered or side-rail styles.

Preview

Installation

npx @lumioui/cli add pro/scroll-spy-tabs

Usage

import { ScrollSpyTabs } from "@/components/ui/scroll-spy-tabs/scroll-spy-tabs";
<ScrollSpyTabs />

Examples

Grocery aisle rail

A grocery store's aisles as a vertical side rail.

Help centre chapters

A help centre read as numbered chapters.

Product page sections

A product page split into Overview / Specs / Reviews.

Restaurant menu

A delivery menu.

API reference

ScrollSpyTabsSection

Prop Type Default
id* string

Stable id — reported by onActiveChange.

—
title* string

Tab label, and the default section heading.

—
count number | string

Muted count after the tab label ("Reviews 128").

—
hideTitle boolean

Hide the built-in heading (render your own inside).

—
className string —
children React.ReactNode —

ScrollSpyTabs

Prop Type Default
header React.ReactNode

Scrolls away above the sticky bar (hero, store header).

—
footer React.ReactNode

After the last section.

—
variant "underline" | "pill"

"underline" — a line under the active tab. "pill" — a filled capsule. Default "underline".

—
layout "top" | "side"

"top" — sticky strip. "side" — vertical rail beside the content. Default "top".

—
fill boolean

Tabs share the bar width equally (2–4 sections).

—
numbered boolean

Prefix tabs with chapter numbers (01, 02…).

—
glide number

Glide distance before a heading reaches the bar. Default 72.

—
railWidth number

Rail width for layout="side". Default 120.

—
onActiveChange (id: string, index: number) => void

Fires when the active section changes (scroll or tap).

—
scrollY SharedValue<number>

Mirror of the content scroll offset, for headers that react to it.

—
className string —
barClassName string

Classes for the sticky bar / rail surface.

—
contentClassName string

Classes for the sections wrapper (padding).

—
children React.ReactNode —