Squarespace 7.1 β€” Sticky TOC Plugin

Just copy/paste this code into a new code block on any blog post.

*NOTE:

  • This won’t work properly if using another TOC plugin

  • This won’t show properly (on desktop) if using a custom sidebar in your site CSS

  • Check out the instructions below for information on edits and troubleshooting

πŸ“œ Sticky Table of Contents for Squarespace

Copy and paste this into a Code Block inside your Squarespace site. This will create a sticky table of contents that appears when scrolling down the page.

Looking for something else?

Check out my other TOC plugins:

H2-only TOC

H2 + H3 TOC

πŸ“Œ Squarespace Sticky Table of Contents Plugin – Quick Start Guide

This plugin creates a floating sticky table of contents on your Squarespace blog post, showing your H2s and H3s in a sleek, clickable format. It only appears after scrolling down the page.

On mobile, it stays at the top.

You can customize it easily with the tips below πŸ‘‡

🧠 How to Add It

  1. Edit your blog post.

  2. Add a Code Block anywhere in the main content area.

  3. Paste the entire TOC plugin code inside it.

  4. Save & preview your post β€” scroll down and voilΓ !

🎨 Customize the Plugin

πŸ”Ή 1. Change the Link Color

Want the links to match your site’s color scheme?

Find this line in the code:

css

CopyEdit

#toc-box a { color: #0070f3; }

Replace #0070f3 with any color you like (Hex, RGB, or blue, hotpink, etc.).

πŸ”Ή 2. Push the TOC Box Further Down

Is your sticky header overlapping the TOC box?

Find this line:

css

CopyEdit

top: 140px;

Increase that number (e.g. top: 180px;) to push the box further down.

πŸ”Ή 3. Adjust the Alignment

Want to nudge the box away from the edge or float it right instead?

Find this line:

css

CopyEdit

left: 10px;

To move it more inward, increase the number.
To align it to the right instead, change it to:

css

CopyEdit

right: 10px; left: auto;

πŸ› οΈ Optional: Tweak the Box Width

If you want a slightly wider or skinnier box, change:

css

CopyEdit

width: 180px;

Try 160px for a tighter look or 200px if your headings are long.

⚠️ Troubleshooting

If the TOC overlaps your blog post content:

  1. Hover near the blog content area in Squarespace Editor.

  2. Click Edit Section.

  3. Scroll to Content Width β†’ choose Custom.

  4. Adjust the width until there's enough space for your TOC box to float beside your content.

πŸ™Œ That’s It!

Once it's set up, your readers can easily jump to any section of your blog. Great for SEO, UX, and longer-form guides.