saturation/uisaturation/ui
DocsComponentsBlocksPages
GitHub

Sections

IntroductionComponentsInstallationMCPTheming

Components

ComponentsAccordionAI Chat InputAlertAnimated GroupAnimated NumberAvatarBadgeBeamBlur FadeBorder TrailBreadcrumbButtonButton GroupCalendar PickerCardChartCheckboxCollapsibleComboboxCommandComparison SliderContext MenuCredit CardData TableDate PickerDialogDropdown MenuEmoji PickerEmptyFieldFiltersFull CalendarGlow EffectInputInput GroupInput OTPItemKanbanKbdMenubarNavigation MenuNovel EditorPaginationParallaxProgressProgressive BlurRadio GroupRippleSelectSeparatorSheetSkeletonSliderSonnerSpinnerSpotlightSwitchTableTabsText EffectText ShimmerTextareaToggleToggle GroupTreeTypography
Docs/Components/Table of Contents

Table of Contents

A navigation component that lists headings on a page with automatic scroll tracking.

Loading...

Installation

pnpm dlx shadcn@latest add https://ui.saturation.io/r/table-of-contents.json

Usage

import { TableOfContents } from "@/components/ui/table-of-contents"
const items = [
  { id: "installation", title: "Installation", level: 2 },
  { id: "usage", title: "Usage", level: 2 },
  { id: "api-reference", title: "API Reference", level: 2 },
]

<TableOfContents items={items} />

API Reference

TableOfContents

PropTypeDefaultDescription
itemsTocItem[]—Array of heading items to display.
activeIdstring—Controlled active heading id.
onActiveChange(id: string) => void—Callback when the active heading changes.
classNamestring—Additional CSS classes.

TocItem

interface TocItem {
  id: string
  title: string
  level: number
}
PreviousSwitchNextTable

On This Page

  • Installation
  • Usage
  • API Reference
  • TableOfContents
  • TocItem
IntroductionGetting StartedInstallationConfigurationUsageAPI Reference