Squarespace Carousel - How to Add a Custom Slider

Squarespace has a built-in gallery block with a slideshow mode, but it's limited to images and doesn't support touch swiping on desktop, multiple visible slides, or transition effects like coverflow or cards.
If you want a real carousel slider on Squarespace - one that handles any content, supports autoplay, and gives you full control - you can add one with Code Injection and a Code Block. No third-party Squarespace apps required.
This guide uses the Swiper carousel from OneType Transforms. See the main carousel slider guide for all features and configuration options.
How to add a carousel slider to Squarespace
You need a Squarespace Core plan or higher (new plans) or Business plan or higher (legacy plans). The Basic/Personal plans don't support JavaScript in Code Blocks or Code Injection.
Step 1: Add the script tag
- Go to Website > Website Tools > Code Injection
- Paste the script tag in the Header field
- Click Save
<script src="https://cdn.transforms.onetype.ai/bundle/{YOUR-TOKEN}.js"></script>
Get your personalized script tag at transforms.onetype.ai/get-started after signing up for a paid plan (their pricing). This loads on every page.
Step 2: Add the carousel HTML
- Edit the page where you want the carousel
- Click Add Block or an insert point
- Select Code
- Click the pencil icon to edit
- Set Type to HTML
- Make sure Display Source is OFF
- Paste the carousel HTML
<div ot="swiper" ot-navigation="true" ot-pagination="bullets" ot-autoplay="true" ot-loop="true">
<div><img src="slide-1.jpg" alt="Slide 1"></div>
<div><img src="slide-2.jpg" alt="Slide 2"></div>
<div><img src="slide-3.jpg" alt="Slide 3"></div>
</div>
The carousel won't render in the Squarespace editor. Preview or publish the page to see it working.
Squarespace carousel examples
Testimonial carousel with fade:
<div ot="swiper" ot-effect="fade" ot-autoplay="true" ot-autoplay-delay="5000" ot-autoplay-pause="true" ot-pagination="bullets">
<div style="padding: 40px; text-align: center;">
<p>"Outstanding work on our rebrand."</p>
<p><strong>- Sarah K., Marketing Director</strong></p>
</div>
<div style="padding: 40px; text-align: center;">
<p>"The best agency we've worked with."</p>
<p><strong>- James R., CEO</strong></p>
</div>
</div>
Portfolio showcase with coverflow:
<div ot="swiper" ot-effect="coverflow" ot-slides-per-view="2" ot-centered="true" ot-loop="true" ot-grab-cursor="true">
<div><img src="project-1.jpg" alt="Project 1"></div>
<div><img src="project-2.jpg" alt="Project 2"></div>
<div><img src="project-3.jpg" alt="Project 3"></div>
<div><img src="project-4.jpg" alt="Project 4"></div>
</div>
Squarespace 7.0 vs 7.1
The carousel works on both Squarespace 7.0 and 7.1. One thing to watch out for: Squarespace 7.0 has Ajax loading which loads new pages without a full refresh. This can break scripts that only fire on initial page load.
If the carousel works on the first page but breaks when navigating to other pages, disable Ajax: Design > Site Styles > uncheck "Enable Ajax Loading". Squarespace 7.1 doesn't have Ajax loading, so this doesn't apply.
Important notes
- Squarespace doesn't let you add custom attributes to its native elements - use Code Blocks with full HTML instead
- Code Blocks with JavaScript require Core/Business plan or higher
- Squarespace support won't help debug custom code - that's on you
- If you downgrade to Basic/Personal, the code stays but stops working
For the full list of options and effects, see the complete carousel slider guide. Browse all transforms at transforms.onetype.ai.