Skip to content

Article Sidebar & TOC

The article sidebar is a 280px sticky column that accompanies long-form content on the tinnitus information site. It combines two blocks — a CTA Compact for conversion and a Table of Contents for navigation — stacked with 24px spacing. On mobile, the sidebar reorders above the article content.

This component uses naluma design system tokens (Plus Jakarta Sans font, warm earth palette).

BEM class: .tinnitus-article-columns__sidebar


PropertyValue
Width280px (fixed on desktop/tablet)
Layoutflex column
Gap24px
Positionsticky, top offset from header height
MobileFull width, order: -1 (moves above content)

PropertyValue
Background
#FBFAF1--semantic-color-surface-primary
Border radius8px
Padding20px
PropertyValue
Text”On this page”
Font size14px
Font weight600
Color
#3D2E2A--semantic-color-text-primary
PropertyStateValue
Font sizeAll14px
Font weightDefault400
Font weightActive600
ColorDefault
#7A6560--semantic-color-text-secondary
ColorActive
#A55838--semantic-color-action-primary
PropertyValue
Left border3px solid
#A55838--semantic-color-action-primary
Left padding12px

The TOC uses JavaScript scroll-spy to highlight the currently visible section:

  1. On page load, scan all h2 and h3 headings in the article content
  2. Generate the TOC link list dynamically
  3. On scroll, use IntersectionObserver to detect which heading is in view
  4. Apply __item--active modifier to the corresponding TOC item
  5. On mobile, the TOC collapses behind a toggle button


  • CTA always appears above the TOC. The CTA is the primary conversion element; the TOC is a navigation aid. This order ensures the CTA is seen first.
  • TOC is generated from article headings. Do not hardcode TOC links — they should be generated dynamically from the article’s h2/h3 structure via JavaScript.
  • Sticky positioning starts below the header. The sidebar’s top value should account for the header height (64px desktop, 58px mobile) plus some breathing room.
  • Mobile reorder, not hide. On mobile viewports, the sidebar moves above the article content rather than disappearing. The TOC collapses to save vertical space.