vamsiy78

Table Of Contents

Navigation

About

An "on this page" navigation list that auto-collects headings (or takes an explicit list), highlights the current section with a scroll spy, slides an indicator to it, and smooth-scrolls below a sticky header on click.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Table Of Contents to your project and fits it to your theme.

Code

How Table Of Contents is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

"use client";
import TableOfContents from "@/components/ui/table-of-contents";
export default function TableOfContentsStates() {
  return (
    <div className="w-56 rounded-xl border bg-card p-4">
      <TableOfContents
        title="In this guide"
        items={[
          { id: "intro", title: "Introduction", level: 2 },
          { id: "setup", title: "Setup", level: 2 },
          { id: "setup-env", title: "Environment", level: 3 },
          { id: "setup-keys", title: "API keys", level: 3 },
          { id: "deploy", title: "Deploy", level: 2 },
        ]}
      />
    </div>
  );
}

Dependencies

More by vamsiy78

View all
  • Segmented Control

    Segmented Control

    8
  • Agent Roster

    Agent Roster

    4
  • API Key Field

    API Key Field

    1
  • Section Tabs

    Section Tabs

  • FAQ Accordion Section

    FAQ Accordion Section

  • Signature Pad

    Signature Pad

  • HUD

    HUD

  • Border Beam

    Border Beam

More in Navigation

View all
  • Footer with Big Wordmark

    Footer with Big Wordmark

    81
  • Liquid Glass Expandable Sidebar

    Liquid Glass Expandable Sidebar

    255
  • Button Breadcrumb

    Button Breadcrumb

    36
  • Sidebar

    Sidebar

    414
  • Astryx Breadcrumb Item

    Astryx Breadcrumb Item

  • Menu

    Menu

    27
  • Progress Bar Stepper

    Progress Bar Stepper

    64
  • Pagination

    Pagination

    14