Installation
npx sdaia-ui@latest add table-of-content
Usage
import { TableOfContent } from '@/components/ui/TableOfContent';<TableOfContent items={[]} />Examples
Default
A table of contents with hierarchical navigation links for in-page sections.
Loading demo: table-of-content-default
API Reference
TableOfContentProps
Props for the TableOfContent component.
Prop | Type | Default | Required |
|---|---|---|---|
label | ReactNode | 'On this page' | optional |
pageName | ReactNode | - | required |
lists | TableOfContentListItem[][] | - | required |
Responsive behavior
How this component behaves at the three system breakpoints. Spacing and type tokens switch automatically at 768px and 1280px.
| Screen | Behavior |
|---|---|
| Desktop (1280px and up) | A column up to 200px wide. |
| Tablet (768–1279px) | Same layout as desktop, with the tablet token values. |
| Phone (under 768px) | Same 200px column; long entries wrap onto more lines. |