Feature - Table of Contents
Auto-generates a collapsible table of contents from titled feature blocks in the same area
What It Does#
Automatically lists all titled feature blocks in the same area
The Table of Contents feature automatically scans the block grid area it is placed in and generates a navigation list from all sibling feature blocks that have a Feature Title set. It requires no configuration — simply add it to an area and it builds the table of contents from the blocks around it.
Unlike the In-Page Navigation feature which uses an editor-driven picker, the Table of Contents is entirely automatic. It discovers its siblings at render time and lists them in the order they appear in the area.
Sticky Collapsed Bar#
Always collapsed, sticks to the top below the navbar when scrolling
The Table of Contents renders as a collapsed card bar with a toggler button. When the editor enables sticky in the block settings, the bar sticks to the top of the viewport just below the site navbar as the user scrolls.
Clicking anywhere on the bar expands the list of section links. After selecting a section, the list collapses automatically and the page scrolls to the chosen section. The scroll position accounts for both the navbar height and the collapsed TOC bar height using CSS custom properties.
A subtle shadow appears on the bar when it is in its stuck state, providing a visual distinction from its inline position. This uses the modern CSS @container scroll-state(stuck: top) query where supported, with an IntersectionObserver fallback for browsers that don't support it yet.
Where to Place It#
Best suited to the main content area of any layout
The Table of Contents is designed for the main content area — the middle column in a multi-column layout, or the full width in a single-column layout. It sits at the top of the content, giving readers an overview of what follows before they start scrolling.
Because it auto-generates from blocks in its own area, placing it in a sidebar would only list the sidebar content, which is rarely useful. For sidebar navigation, use the In-Page Navigation or Nested Descendants features instead.
The feature works with any layout that accepts feature blocks. Simply add it as the first block in an area and it will list all the titled siblings that follow it.
Technical Notes#
Implementation details for developers
The Table of Contents view traverses the block grid layout structure to find the area containing the TOC block by matching its own ContentKey. It then iterates the sibling blocks in that area, filtering for feature blocks with a featurePropertyFeatureTitle value.
Fragment IDs use the same SlugHelper.ToSlug() method as all other features — a slugified title with a 4-character GUID suffix for collision resistance. ScrollSpy highlights the active section as the user scrolls.