Layout

PageOutline

A sticky outline of the page's sections that follows the scroll. Shown from 1100px up. Works with the window or your own scroll container.

view .md
Preview
Installation
terminal
bash
npx @entrepta/cli@latest add page-outline

// Resolves dependencies, copies the source, and installs npm packages automatically.

Usage
page-outline.tsx
tsx
import { PageOutline } from "@/components/entrepta/page-outline"

<PageOutline
  file="about.md"
  items={[
    { id: "intro", label: "intro", level: 1 },
    { id: "career", label: "career", level: 2, count: 4 },
  ]}
  scrollContainer={() => document.querySelector("main")}
/>
Props
PropTypeDefaultDescription
items{ id, label, level, count? }[]-One per section id on the page
filestring-Name in the chip at the top
footerReactNode-Lines under the list
scrollContainer() => HTMLElement | null-What scrolls, when it is not the window
offsetnumber24Space above a heading after a jump
Active theme: entrepta, dark mode.