The Custom liquid section type lets you inject Liquid and HTML directly into any page template without editing theme source files. It is the fastest way to add a one-off snippet of dynamic or interactive content.
Custom liquid is a good fit when:
x-data without building a full block or section.If you find yourself needing the same snippet in multiple places, or if you want merchants to be able to configure the content from the theme editor, consider creating a custom block or creating a custom section instead.
AI coding agents are well-suited to writing custom liquid snippets. Slab uses Alpine.js for interactivity, so you can ask an agent to generate snippets that combine Liquid with Alpine's x-data and x-init directives.
A useful prompt structure:
Write a Shopify Liquid snippet using Alpine.js x-data that [describe what you want it to do]. Use utility classes from the Slab theme for styling where appropriate.
Example: live clock for a timezone
The snippet below uses Alpine's x-data to display the current time in Toronto, updated every second. It was generated with this prompt:
Write a Shopify Liquid + Alpine.js snippet that displays the current local time in Toronto, updated every second. Use x-data and x-init.
<div class="color-tx__shade-3">
Site made with Slab / <span
x-data="{
time: '',
update() {
this.time = new Intl.DateTimeFormat('en-CA', {
timeZone: 'America/Toronto',
hour: 'numeric',
minute: '2-digit',
hour12: true
}).format(new Date())
}
}"
x-init="update(); setInterval(() => update(), 1000)"
x-text="time"
></span> in Toronto
</div>
Start by connecting your source repository and choosing the pages you want to publish.
You can then browse your documentation and ask questions about the content your team has shared.