Skip to content
ghostui

Table of contents

Navigate page headings and identify the section in view.

Preview

Installation

Install

Basic usage

The full view shows every accepted heading with native anchors. Branches have no disclosure arrows by default. Set collapsible to enable independent branch controls. The caller owns heading discovery, scroll observation, hash updates, and focus. The compact selector calls onNavigate after a choice, while modified clicks keep native browser behavior.

Structure

Examples

Nested tree

Show the full heading hierarchy without collapse controls.

Compact selector

At tablet widths and below, the section selector uses ghost styling with a progress clock inside the leading edge of its trigger. Set responsive={false} to use this compact layout in an embedded narrow host at any viewport width.

Hidden compact mode

Depth-limited and collapsible

Enable collapsible to let readers hide nested headings. Heading labels keep their native navigation action.

API reference

readingProgress accepts a fraction from 0 to 1 supplied by the caller. It fills the compact clock. The desktop rail highlights only the active heading, starting at that heading’s row. The compact clock has no numeric counter. Scroll observation belongs to the consuming page. The heading list uses 12 px text at every depth.