Skip to main content

BETANow in public beta.Public betaBeta

日本語Español

TOC-001 Published · Updated

Top-of-article table of contents

A table of contents that lists the headings before the body text and stays visible.

FigmaThis part is included in our free, editable Figma file: 235 website UI patterns across 32 parts, 2 designs each Open in Figma Community ↗ (opens in a new tab)

Wireframe (desktop) | Top-of-article table of contents

Top-of-article table of contents UI design (desktop wireframe)

Wireframe (mobile) | Top-of-article table of contents

Top-of-article table of contents UI design (mobile wireframe)

What changes on mobile

  1. Keep tap areas at least 44px high: Items to tap are stacked, so even with smaller text the tap area should not shrink.
  2. Wrap headings that do not fit on one line: Cutting off the end leaves readers unsure where the item leads.

Before you choose this pattern | Top-of-article table of contents

Good fit

  • Five to eight headings, so the contents fit on one screen
  • Readers come for one particular section (how-tos, comparisons, explanations of terms)
  • You want search engines and AI to see the article's structure up front

Poor fit

Why this wireframe works | Top-of-article table of contents

The structure is clear before reading

With the headings listed, readers can tell what the article covers and whether what they want is there before they start. If the section they need is missing, they can leave before reading.

Always visible, nothing to learn

There is nothing to open or close, so the items can be pressed as soon as the page opens. First-time visitors are never unsure how to use it.

Never out of step with the headings

The contents are built from the body headings, so editing a heading never leaves an old item behind. Search engines and AI also see the structure as a list of headings.

Common mistakes | Top-of-article table of contents

Listing h3 too, so the contents grow long

Adding subheadings pushes the list past 20 items and the contents fill the screen. List h2 only and leave finer headings to the body.

Headings hidden under a sticky header after the jump

After moving from the contents, the heading slides under the fixed header and readers cannot tell where they are. Give headings scroll-margin-top equal to the header height.

Contents made as an image or typed by hand

When a heading changes, the contents do not, and items lead to the wrong place. Generate the contents automatically from the body headings.

Items worded differently from the headings

When the contents use shortened wording that does not match the heading, readers have to check whether they landed in the right place. Use the heading text as it is.

FAQ | Top-of-article table of contents

How many items can the contents have?

About five to eight. Keep it within one screen on desktop and two on mobile. Beyond that, drop h3 or switch to the collapsible type (TOC-002).

Does the contents need a heading that says Contents?

Even when it is visibly a table of contents, the nav needs a name for screen readers. If you do not want a visible heading, add aria-label with the name Contents.

Should the table of contents at the top start expanded?

This pattern assumes the table of contents is always visible, so place it expanded. If there are so many entries that the article gets pushed down, limit it to h2 headings or consider the collapsible pattern that starts closed.

Related pages

Share this pattern

Send this page to your team or your design partner.

Was this pattern useful?

Written by

Yuta Okano

ENVY DESIGN Inc.

CEO / Director / Designer

14 years in the web industry. Has worked on more than 500 web projects, from corporate and recruiting sites to e-commerce. Focuses on information architecture, direction and design, from planning websites to improving them. In recent years he has focused on AIO (AI optimization) and GEO, helping sites get cited by generative AI search such as ChatGPT, Perplexity and Google AI Overviews.

Review and revision history

  1. Published AvatarYuta Okano Pattern published