Browse Components

Components

Table of contents

Tables of contents provide a page overview and direct access to specific sections.

DesignUsageAccessibilityUpdates

Purpose

Navigate long pages

Use a table of contents to link directly to sections on the same page.

Show page structure

A list of headings helps users understand what the page contains.

Keep section links nearby

Use it on long documentation, guidance, or policy pages.

Anatomy

1

Header

2

Link(s)

Structure

Design tokens used

Each row is a colour, spacing, or size value the component uses, and the right-most column tells you where in the component you'll see it.

CategoryTokenValueWhere it's usedPaddingsgds-padding-noneSpace between the edges of the component and its contentGapsgds-gap-md16pxSpacing between items of the container; spacing between items of the contentsMarginsgds-margin-noneOuter spacing of the content; outer spacing of the contentsTypographysgds-font-size-subtitle-mdFont size of the contentsgds-font-weight-semiboldFont weight of the contentsgds-line-height-xsHeight variesLine height of the content

Usage

When to use

  • Use this component when users need to compare structured results or move through a long list in a predictable way.
  • Use it when the component reduces effort for scanning, comparison, or navigation across related records.

When not to use

  • Do not use this component when the content is short enough to show directly without extra controls.
  • Do not split short information into more pages, rows, or controls than users need.

Best practices

Use a table of contents on long, scannable pages

Documentation, policy pages, and long-form articles benefit most. Each link should map to a heading.

On this page

  • Summary
  • Do not use a table of contents on short pages

    If the page fits on one or two screens, a table of contents adds little value and competes with the body.

    Label the block with a clear heading

    Use a short heading like On this page or Contents so users immediately recognise the navigation block.

    Explore services

  • Services
  • Forms
  • Contact
  • Do not use it for site-level navigation

    Table of contents links should stay within the current page. Use mainnav or sidenav when users need to move across pages.

    Mirror the page's heading structure

    Each link should match a real heading in the same order. Out-of-sync entries break trust and create dead links.

    On this page

  • Overview
  • Eligibility
  • Fees
  • Do not link to missing or duplicate sections

    Each anchor must match one unique section id on the page. Broken or repeated ids can send users to the wrong place.

    Do not nest contents links

    Nested lists are not part of the SGDS table of contents structure and may not receive the component's spacing or list treatment.

    Accessibility considerations

    Built-in accessibility

    • Tables of contents provide structured lists of page links.
    • Links placed in the contents slot keep their native link behaviour.

    Labels and content

    • Use section names that match the headings on the page.
    • Keep the table of contents updated when sections change.

    Focus and interaction

    • Users should be able to tab through each contents link in page order.
    • Do not include links to sections that are hidden or missing.

    Keyboard interaction

    KeyInteractionTabMoves focus from the table of contents link to the next focusable element.Shift+TabMoves focus to the previous interactive element.EnterActivates the focused table of contents link.

    Updates

    DateVersionDescription29 Apr 2026v3.18.0Update heading style in #619.

    Roadmap

    Planned itemStatusTargetFuture enhancements for table of contentsPlannedTBD

    Feedback

    Have suggestions or feedback?

    Share them with us on Slack → #ask-sgds-v3

    Bug Reports

    Found a bug or issue?

    Report it on GitHub Issues → sgds/components/table-of-contents

    Singapore Government Design System

    The Singapore Government Design System was developed to empower teams in creating fast, accessible and mobile-friendly digital services.

    Past VersionsSGDS v1SGDS v2