Skip to main content

BETANow in public beta.Public betaBeta

日本語Español

TOC-003 Published · Updated

Sticky sidebar table of contents

On desktop, a table of contents fixed beside the body that highlights the section being read as you scroll.

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) | Sticky sidebar table of contents

Sticky sidebar table of contents UI design (desktop wireframe)

Wireframe (mobile) | Sticky sidebar table of contents

Sticky sidebar table of contents UI design (mobile wireframe)

What changes on mobile

  1. Stop sticking and switch to a collapsible list at the top: Fixing the contents on a narrow screen leaves no room to read the body.
  2. Do not carry over the current-section highlight: Updating contents that are not visible tells readers nothing and only adds processing.

Before you choose this pattern | Sticky sidebar table of contents

Good fit

  • Articles over about 2,500 words where readers move between sections (guides, manuals, glossaries)
  • Mostly read on desktop, with room for a sidebar
  • No plans for ads or banners in the sidebar (they compete for the space)

Poor fit

Why this wireframe works | Sticky sidebar table of contents

Readers always know where they are

The highlight moves as they scroll, so even midway through a long article they never lose their place in the whole. Knowing how much is left also makes it easier to decide whether to read to the end.

Another section is always one click away

The contents never leave the screen, so readers move to the next section without going back to the top. In articles followed step by step, moving back and forth gets easier.

No space taken from the body

It uses the free space beside the body, so there is no need to make room for contents at the top or between paragraphs. The article goes straight from the introduction into the body.

Common mistakes | Sticky sidebar table of contents

Contents taller than the screen, hiding the lower items

With many items, the bottom half of the fixed contents stays off screen. Add max-height and scroll inside the contents, or drop h3 to reduce items.

A pale highlight shown only by color

A slight change of text color does not show the current item at a glance. Add a difference beyond color, such as bold text and a left line.

A flickering highlight that skips short sections

Moving the highlight the moment a heading enters the screen makes it jump around where short sections follow each other. Treat the heading that passes a line about 30% from the top as current, with a single line for detection.

Contents overlapping the footer

If the contents stay fixed after the body ends, they sit over the footer and related articles. Make the contents’ parent as tall as the body so they stop where the body ends.

FAQ | Sticky sidebar table of contents

Should the contents go on the left or the right?

Readers start the body from the left, so contents on the right stay out of the way. On sites with a left sidebar navigation, the navigation and contents can share one column.

Is highlighting the current section essential?

Fixing it in place already lets readers move around, but half the reason for a sticky table of contents is showing where readers are. Without the highlight, the top-of-article type (TOC-001) is often enough.

Can h3 be included?

Sidebar height is limited, so keep to h2. If you really want h3, consider the nested type (TOC-004), which opens only the subheadings of the current section.

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