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:
π 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
Edit your blog post.
Add a Code Block anywhere in the main content area.
Paste the entire TOC plugin code inside it.
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:
cssCopyEdit
#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:
cssCopyEdit
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:
cssCopyEdit
left: 10px;
To move it more inward, increase the number.
To align it to the right instead, change it to:
cssCopyEdit
right: 10px; left: auto;
π οΈ Optional: Tweak the Box Width
If you want a slightly wider or skinnier box, change:
cssCopyEdit
width: 180px;
Try 160px for a tighter look or 200px if your headings are long.
β οΈ Troubleshooting
If the TOC overlaps your blog post content:
Hover near the blog content area in Squarespace Editor.
Click Edit Section.
Scroll to Content Width β choose Custom.
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.