# On This Page

> A section outline where a dot rides a rail with your scroll, subsections fold open as you reach them, and clicking jumps to a section.

## Spec sheet

| | |
| --- | --- |
| Access | Free: no account, free for commercial use |
| Shelf | Components › Navigation |
| Live preview | https://uibrik.com/components/on-this-page |
| Writes | 1 file into `components/uibrik/on-this-page/` |
| Packages | `@tabler/icons-react`, `motion` (the CLI installs them) |
| Needs | React 19, Tailwind CSS v4, a project set up with `npx shadcn@latest init` |
| Theme | Reads the shadcn tokens and follows class-based dark mode ([theming](https://uibrik.com/docs/theming.md)) |
| Updated | Nov 9, 2026 |

## Add it

```bash
npx shadcn@latest add https://uibrik.com/r/on-this-page.json
```

With the `@uibrik` namespace in `components.json` ([setup](https://uibrik.com/docs/installation.md)): `npx shadcn@latest add @uibrik/on-this-page`.

Can't run commands? https://uibrik.com/components/on-this-page/prompt.txt has every file verbatim, with the setup steps, ready for an assistant to write.

## Render it

Renders as is; every value shown is the default, so delete any line you don't need.

```tsx
import { OnThisPage } from "@/components/uibrik/on-this-page/on-this-page";

const sections = [
  { id: "overview", title: "Overview" },
  {
    id: "install",
    title: "Installation",
    children: [
      { id: "requirements", title: "Requirements" },
      { id: "manual-setup", title: "Manual setup" },
    ],
  },
];

<OnThisPage
  sections={sections}
  label="On this page"
  offset={96}
  inset={18}
  curve={0.5}
  bendRoom={8}
  sectionGap={8}
  subsectionGap={0}
  maxSubsections={5}
  rowHeight={32}
  lineWidth={2}
  dotSize={8}
  container={null}
/>
```

## Tune it

The same props as the Customize panel on https://uibrik.com/components/on-this-page.

| Prop | Type | Default | What it does |
| --- | --- | --- | --- |
| `label` | `string` | `"On this page"` | Heading above the list. |
| `offset` | `number` | `96` | Distance from the top of the scroller where a section counts as current. |
| `inset` | `number` | `18` | How far in the subsection line sits from the main line. |
| `curve` | `number` | `0.5` | Softness of the bend between the two lines. 0.5 is the classic S; lower is tighter. |
| `bendRoom` | `number` | `8` | Extra space above a group's first subsection, giving the bend more room. |
| `sectionGap` | `number` | `8` | Extra space above each new section. |
| `subsectionGap` | `number` | `0` | Space between subsections. Negative values tighten them past the row height. |
| `maxSubsections` | `number` | `5` | Most subsections shown at once for one section; the rest sit behind a More above or More below row and slide in as you go. 0 shows all. |
| `rowHeight` | `number` | `32` | Height of one row. |
| `lineWidth` | `number` | `2` | Thickness of the rail. |
| `dotSize` | `number` | `8` | Diameter of the dot. |

## Wire it

The props the Customize panel doesn't show: ranges, data, content and callbacks.

| Prop | Type | Default | What it does |
| --- | --- | --- | --- |
| `sections` (required) | `{ id: string; title: string; children?: { id: string; title: string }[] }[]` |  | Sections to list, each with optional subsections one level deep. Each id is the id of an element on the page. |
| `container` | `RefObject<HTMLElement \| null>` |  | Scrolling element to follow. Defaults to the window. |
| `className` | `string` |  | Classes for the wrapper. |

## Where it fits

- **Docs table of contents**: A dot riding a rail with your scroll shows where you are on a long page. Pairs with [Section Pill](https://uibrik.com/components/section-pill.md).
- **Long guides and blog posts**: Subsections folding open as you reach them keep the outline short. Pairs with [Tick Nav](https://uibrik.com/components/tick-nav.md).
- **Legal and policy pages**: Clicking a section to jump makes long terms and privacy pages navigable.

## Same shelf: Navigation

- [Page Indicator](https://uibrik.com/components/page-indicator.md): Pagination dashes you can click, scrub, step with arrows or type into.
- [Pagination](https://uibrik.com/components/pagination.md): Pagination that never changes width: the current-page pill slides between slots, page numbers roll like an odometer when the window shifts, and an ellipsis opens into a jump-to-page field.
- [Progress Dots](https://uibrik.com/components/progress-dots.md): Pagination dots where the active one stretches into a pill that fills as it plays, and the row opens into labelled steps on hover. Also comes as full-width story segments.
- [Search](https://uibrik.com/components/search.md) (Pro): A search pill that grows into a palette with filter chips and results.
- [Section Pill](https://uibrik.com/components/section-pill.md): A floating pill that names the section you're reading, with a ring for how far down the page you are, and opens into the full list, carrying the current title to its row.
- [Tick Nav](https://uibrik.com/components/tick-nav.md): A section list on a ruler whose ticks swell like a dock under the pointer, sliding each label out with its tick.

## Ground rules

- Only the props above exist. To change anything else, edit the installed file.
- Keep the files in `components/uibrik/on-this-page/` so the import paths keep resolving.
- The playbook for working with the whole library: https://uibrik.com/llms.txt
