Add a Collapsible Floating Side Navigation Menu with Icons to Squarespace
In today’s tutorial we have a code snippet that adds a floating side navigation to your Squarespace website. This menu is fully collapsible and activates when you click the plus sign icon, keeping your UX clean and uncluttered. I’ve embedded the menu on this page as a live demo, just click on the plus icon on the bottom right of the screen to toggle the menu.
This menu keeps navigation items within easy reach, and gives you full control over the pages that you link to. Follow along to implement this on your site!
Features of the Floating Collapsible Side Navigation for Squarespace
Collapsible Menu: A floating toggle button that opens/closes the navigation.
Change Titles and Links: By modifying the HTML of the menu you can change the title of the menu items and their links.
Icon Support: Easily replace default SVGs with your own icons or images.
Active Page Highlighting: Dynamically shows which page is currently active.
Responsive Design: Works on desktop, tablet, and mobile.
Easy Customization: Change colors, fonts, backgrounds, and positions with simple CSS variables.
How to Add the Side Navigation Menu to your Squarespace Website
1. Add the HTML
First, we will need to create the HTML code structure for the floating menu. This will go into the Code Injection section of your Squarespace site.
Go to Website >Pages > Website Tools > Code Injection
Paste this code to the Footer Injection:
2. Add the JavaScript
Next, paste this code below the HTML code we just added to the Footer Injection panel.
Go to Website >Pages > Website Tools > Code Injection
Add this script to the Footer Injection:
3. Add the CSS:
Go to Website >Pages > Website Tools > Custom CSS
Paste the following code:
Customize the Code
Use CSS Shortcuts to Customize the Menu Styles
These shortcuts (CSS variables) let you quickly change the look of your navigation without editing multiple lines of code. Just update the values at the top of the CSS code, and the changes will apply everywhere.
What Each Shortcut Does and Where to Modify:
Text Color – Controls the color of the navigation text.
Modify:
--floating-nav-text-color
Background Color – Sets the main background of the navigation.
Modify:
--floating-nav-bg-color
Button Color – Changes the background color of the floating toggle button.
Modify:
--floating-nav-toggle-bg-color
Hover Color – Adjusts the color when you hover over a navigation item.
Modify:
--floating-nav-icon-hover-bg-color
Active Item Color – Highlights the current page in the navigation.
Modify:
--floating-nav-active-text-color
Icon Color – Controls the color of the icons inside the navigation.
Modify:
--floating-nav-icon-color
Border Radius – Changes how rounded the buttons and icons look. Increase for a softer look, decrease for sharper edges.
Modify:
--floating-nav-border-radius
(for the full menu)Modify:
--floating-nav-icon-border-radius
(for icons only)
Position – Moves the navigation to the left, right, top, or bottom.
Modify:
--floating-nav-bottom
(distance from bottom)Modify:
--floating-nav-left
(distance from left)
Change the Position of the Menu Toggle Button (+)
Change the value in the data position attribute in the HTML code we pasted in the Footer Injection panel. You can position the button to either left or right. The bolded text below is what needs to be updated.
<div class="floating-nav" data-position="right" data-vertical-align="bottom"> ... </div>
Use Your Own Icons
Inside each
<div class="icon-wrapper">
, replace the<svg>
with an<img>
tag:
<img src="https://example.com/my-custom-icon.png" alt="Icon">Change the Link URL
Update the HTML
href
attribute in each<a>
tag to point to any page/URL:
<a href="https://example.com" class="nav-item"> ... </a>

Need help implementing this code on your website?
Looking for a custom Squarespace solution or need assistance tweaking this code? Minimist specializes in modern web design and Squarespace coding to fit your needs. Whether it’s styling adjustments, added functionality, or a fully custom site, I can help.
Book a Free Consultation