How to Add a Sticky Table of Contents in Elementor

Elementor article with a numbered table of contents pinned in the sidebar

Key Takeaways

  • For an Elementor sticky table of contents you need a sidebar column that is taller than the box and a sticky rule on the table of contents widget inside that column.
  • The Master Addons Table of Contents widget has no sticky switch, so the box is made sticky with the rule selector { position: sticky; top: 32px; } in the Master Addons Custom CSS section of the widget’s Advanced tab.
  • Elementor Pro users can skip the CSS and use Advanced > Motion Effects > Sticky set to Top, with an Offset in pixels and Stay In Column turned on, since Elementor without Pro has no Sticky option in Motion Effects.
  • A sticky table of contents stops working when any parent container has overflow set to hidden, when the sidebar column is no taller than the box, or when the sticky rule sits on a column that already fills the row.
  • On phones the sidebar drops under the article, so the usual mobile setup is a collapsible box loaded closed with Keep Collapsed Initially, or a second collapsed copy above the article shown only on mobile.

An Elementor sticky table of contents is a list of the page’s headings that stays in view while the reader scrolls, usually at the top of a sidebar next to a long article. The Master Addons Table of Contents widget builds that list from your headings but has no sticky switch of its own, so you make it stick with one line of CSS or with Elementor Pro’s Motion Effects.

Below, you’ll build the sticky version step by step on Elementor without Pro, then see the Elementor Pro route, how to set the top offset under a fixed header, why sticky sometimes fails and what to do on mobile. A short comparison with the floating options in dedicated table of contents plugins comes last.

What a sticky table of contents is

A sticky table of contents scrolls with the page until it reaches a set distance from the top of the window, then stays there while the article keeps moving past it. When the bottom of its column arrives, it scrolls away with the column. That behavior comes from the CSS value position: sticky, which MDN describes as an element that acts as relative until it crosses a threshold and then as fixed, inside the bounds of its containing block.

Pay attention to that last part about the containing block: a sticky box can only move inside its parent. If the parent is exactly as tall as the box, there is nowhere to move, and the box scrolls off like any other element.

Set up the layout: content column and sidebar column

The layout is a row container with two columns: a wide one for the article and a narrow one for the table of contents. In Elementor 4 that means a container with Direction set to Row, holding two child containers. A split of roughly 65 to 70 percent for the content and 30 to 35 percent for the sidebar reads well on a desktop screen.

Leave the sidebar column at its default height. Child containers in a row stretch to the height of the tallest sibling, so the sidebar column grows as long as the article next to it. That long, mostly empty column is the track the sticky box slides down. Don’t give it a fixed height, and leave its vertical alignment alone (no center or end).

Elementor page with a vegetable garden article in a wide left column and a numbered table of contents titled On this page in a light gray box at the top of a narrow right sidebar
The starting layout: the article on the left, the table of contents at the top of a sidebar column that is as tall as the article.

Make the table of contents sticky without Elementor Pro

On Elementor without Pro, the sticky rule goes on the widget through the Master Addons Custom CSS extension. The setup takes four steps.

Step 1: Add the Table of Contents widget to the sidebar

Install Master Addons, which includes the Table of Contents widget, open the page in Elementor and type Table of Contents in the widget search. Drag the widget with the MA badge into the sidebar column. If the page has headings in the content column, the list fills in straight away in the editor preview.

Step 2: Pick the headings and the list style

In the Content tab, set Enter Title Text (the lab page uses “On this page”), choose a List Style of Default, Bullets or Numbers, and open the Include tab to pick the Heading Tags. The default is H2, H3 and H4. For a sidebar, H2 and H3 are usually enough, since a sticky box is pointless once the list grows taller than the screen. Turn on Make Content Collapsible now as well, because you’ll want it for mobile later.

Elementor editor with the Master Addons Table of Contents widget selected, Content tab showing title On this page, Numbers list style, Heading Tags H2 and H3, Show Separator on and Make Content Collapsible on, next to the article and sidebar preview
Content tab settings for a sidebar list: H2 and H3 only, numbered, with the collapsible toggle switched on.

Step 3: Paste the sticky rule into Custom CSS

Switch to the Advanced tab and scroll down. There are two sections named Custom CSS. The higher one is Elementor Pro’s and only shows a teaser without Pro. The lower one carries the MA badge and belongs to the Master Addons Custom CSS extension. Open that one and paste:

selector {
  position: sticky;
  top: 32px;
}

The word selector stands for the widget’s own wrapper, so the rule applies to this widget only. The 32 px value leaves a small gap between the box and the top of the window, which also clears the WordPress admin bar when you are logged in.

Advanced tab of the Master Addons Table of Contents widget with the Master Addons Custom CSS section open, containing selector position sticky and top 32px, below Positioning and Entrance Animation sections marked with the MA badge
The sticky rule in the Master Addons Custom CSS section, the one with the MA badge lower in the Advanced tab.

Step 4: Publish and test on the front end

The editor preview may not show sticky behavior, so publish and open the page in a new tab. Scroll down the article. The box should travel with the page until it is 32 px from the top, then hold its place while the headings keep moving. Click an item and the page jumps to that heading, and the clicked item takes the Active color from the Style tab.

Same Elementor page scrolled down to the Build the beds section, with the On this page table of contents still at the top of the sidebar and the Build the beds item highlighted in pink
Scrolled halfway down: the box has stayed at the top of the sidebar, and the clicked item shows the Active color.

The widget marks the item you clicked and does not follow your scrolling, so the pink item stays on “Build the beds” until you click another one. The live sticky sidebar demo uses this exact setup with a larger offset, if you want to scroll a working copy before you build your own.

Want the full list of controls first? The Table of Contents widget page covers heading detection, list styles, the collapsible box and the back to top arrow, with live demos of each.

Make it sticky with Elementor Pro Motion Effects

If you have Elementor Pro, you can make the same box sticky without writing CSS. Select the Table of Contents widget, go to Advanced > Motion Effects and set Sticky to Top. Set Offset to the gap you want above the box, in pixels, and turn on Stay In Column so the box stops at the bottom of the sidebar instead of floating over the footer.

Elementor Pro sticky is handled by JavaScript and applies to the element you select, so the layout rules above still hold. Put it on the widget, keep the sidebar column tall and test on the front end. On any one widget, use Motion Effects or the CSS rule, never both at once.

Elementor Pro also has its own Table of Contents widget. Its help article lists an active item that follows scrolling, a Minimize Box option tied to a breakpoint and anchor settings by tag or selector, and it needs Pro like the sticky option does. If you already pay for Pro, both routes are open to you.

Choose the top offset under a fixed header

The top value should be the height of anything fixed at the top of the screen plus a small gap. Without a fixed header, 24 to 32 px is fine. With a sticky header, measure it: an 80 px header needs a top value of about 110 px, which is what the live demo uses. If the box slides under the header when you scroll, raise the number until it sits just below.

Master Addons live demo of a sticky table of contents in Elementor scrolled to the Build the beds section, with the numbered On this page box held in view in the right sidebar about 110 pixels below the top
The live demo mid-scroll. Its box uses a 110 px top value so it clears a fixed header.

Fix headings that land under the header

A fixed header causes a second problem: clicking an item scrolls the heading to about 30 px from the top, and the header then covers it. The widget has a Smooth Scroll Offset control in its Scroll section. If the offset setting has no effect on your site, add this rule under Appearance > Customize > Additional CSS:

.elementor-heading-title[id] {
  padding-top: 90px;
  margin-top: -90px;
}

Each heading the widget links to now stops 90 px lower, and the padding and negative margin cancel out, so the page looks the same. Change 90 to your header height plus a little room. The rule targets Elementor Heading widgets with an id, which are the ones the table of contents gives anchors to.

Why your sticky table of contents is not sticking

When the box scrolls away with the page, the cause is almost always one of these three layout problems.

A parent has overflow set to hidden

Sticky positioning stops working inside any ancestor with overflow: hidden, auto or scroll. Check the sidebar column, the row container and every container above them: Elementor containers have an Overflow setting in the Layout tab under Additional Settings. Some themes set overflow hidden on the page wrapper to stop horizontal scrolling. Inspect the box in your browser’s developer tools and walk up the parents to find it, then set it back to default or move the rule higher in the tree.

The column is not taller than the box

If the sidebar column has its height set, its alignment changed to center, or the row’s Align Items is set to anything other than stretch, the column shrinks to the size of the box and sticky has no room to move. Put the column back to default height and alignment. A very short article causes the same symptom: when the content is barely longer than the list, the box has a few pixels to travel and seems not to stick at all.

Sticky is set on the column

It seems natural to put the rule or Elementor Pro’s Sticky on the sidebar column. That column is the full-height element, though, and it already fills the row, so it has nowhere to go. The sticky rule belongs on the widget inside it, or on a small inner container wrapping the widget if you want the box and a call to action under it to stick together.

A separate issue can look like a sticky failure: a box that shows its title but no list until you scroll or click. That comes from caching plugins that delay JavaScript, such as LiteSpeed’s Delay JS or WP Rocket’s Delay JavaScript execution. Exclude the Master Addons table of contents script (ma-table-of-contents) or jQuery from the delay and the list loads straight away. The Table of Contents documentation covers the remaining settings.

Sticky table of contents on mobile

On phones the row stacks and the sidebar drops under the article, where a sticky box helps nobody. Two patterns work well here, and both use the widget’s collapsible box.

The simple one keeps a single widget. Turn on Make Content Collapsible and Keep Collapsed Initially, so the box loads showing only its title and the toggle icon. On a desktop sidebar a reader opens it with one click; on mobile it takes very little space wherever it lands. The collapse setting applies on every device, so test it on the desktop layout too.

Master Addons table of contents box open, showing On this page title with a toggle icon and a numbered list of headings with sub items
The box open.
Master Addons table of contents box collapsed to its On this page title and toggle icon
The same box loaded closed with Keep Collapsed Initially, which is how it takes the least room on a phone.

The second pattern uses two copies. Keep the sticky widget in the sidebar and hide it on mobile from Advanced > Responsive. Then add a second Table of Contents widget above the article with Keep Collapsed Initially on, and hide that copy on desktop and tablet. Phone readers get a folded list at the top of the post, which is where they look for one, and desktop readers get the sticky sidebar. Both widgets read the same headings, so there is nothing extra to maintain. You can pair either pattern with the reading progress bar extension to show mobile readers how far through a long post they are.

When a single post template is the better place

Building the sidebar by hand on each page makes sense for a few long guides. For a blog, put the row, the sidebar and the sticky widget into a single post template once and every post gets them. Master Addons has a Theme Builder where the Single template type is a Pro feature, and Elementor Pro’s Theme Builder does the same job.

In a template, the widget looks for headings inside .entry-content first, then .page-content, then the Elementor content area. Preview the template on a real post and check that the list shows the article’s headings and none from the header or footer. Add the class jltma-toc-hide-heading to any heading you want left out. A list built from clean H2s also helps search engines understand the page, a point covered in our Elementor SEO practices guide.

Custom CSS vs Elementor Pro vs a TOC plugin

You can get a table of contents that stays in view three ways. What changes between them is what you need installed and how much control you keep over the layout.

FactorMaster Addons + Custom CSSElementor Pro Motion EffectsA TOC plugin’s floating option
What you needElementor and Master Addons, no Elementor ProElementor ProA separate plugin, often its Pro version
How it sticksposition: sticky on the widget, one CSS ruleSticky: Top with Offset and Stay In ColumnEasy Table of Contents: sidebar widget that can be affixed, fixed TOC is Pro. Joli Table of Contents: floating TOC is Pro
Where it sitsAny Elementor column you buildAny Elementor column you buildWordPress widget area or the plugin’s own position
Active itemItem last clickedDepends on the widget you make stickyVaries by plugin
MobileCollapsible box, Keep Collapsed Initially, Responsive hideSame Responsive controlsVaries by plugin

Pick the Custom CSS route with the Master Addons table of contents if you run Elementor without Pro and design pages in Elementor. Pick Motion Effects if you already own Elementor Pro. A dedicated plugin suits sites that mostly publish in the block editor; our best table of contents plugin roundup compares eight plugins, sticky options included.

Frequently asked questions

Can I make a table of contents sticky in Elementor without Pro?

Yes. Put the Master Addons Table of Contents widget in a narrow sidebar column of a row container, then add selector { position: sticky; top: 32px; } in the Master Addons Custom CSS section of the widget’s Advanced tab. Elementor without Pro has no Sticky option in Motion Effects, so the CSS rule does that job.

Why is my sticky table of contents not working?

The usual causes are a parent container or theme wrapper with overflow set to hidden, a sidebar column that is no taller than the box, or a sticky rule set on the full-height column instead of the widget. Fix those and test on the published page, since the editor preview may not show sticky behavior.

How do I show a sticky table of contents on mobile?

On phones the sidebar stacks under the article, so sticky in the sidebar helps little there. Turn on Make Content Collapsible and Keep Collapsed Initially, or add a second collapsed Table of Contents widget above the article and use Advanced > Responsive to show each copy only on the devices it suits.

Does Elementor have a sticky table of contents widget?

Elementor Pro has a Table of Contents widget, and any widget can be made sticky with Elementor Pro’s Motion Effects. Free Elementor has neither. The Master Addons Table of Contents widget runs without Elementor Pro and becomes sticky with one Custom CSS rule.

What top value should I use under a sticky header?

Use the height of the fixed header plus about 30 px. An 80 px header works with a top value of about 110 px. Raise the value if the box slides under the header while you scroll.

Final thoughts

An Elementor sticky table of contents comes down to a row container, a sidebar column left at its default stretch height, and one sticky rule on the widget: position: sticky; top: 32px; in the Master Addons Custom CSS section, or Sticky: Top with an Offset and Stay In Column in Elementor Pro. Raise the top value under a fixed header (110 px for an 80 px header), check parents for overflow hidden when it does not stick, and give phone readers a collapsed box above the article. Scroll the sticky sidebar demo to see the finished result, then add the Table of Contents widget to your own layout.

Picture of Roy Jemee
Roy Jemee
I'm Roy Jemee, Content Wrangler and Marketer at Pixar Labs, working on Master Addons for Elementor. I write the tutorials, record the videos, and keep the documentation current, so you always know how to use every feature. I also handle support, so if you hit a snag, I'm the person who helps you fix it. Real answers, from someone who uses these tools every day.

Leave a Reply

Your email address will not be published. Required fields are marked *