Skip to main content

Introduction

Theme blocks are the foundation of Horizon’s architecture, enabling unprecedented flexibility and reusability. With 94 theme blocks in Horizon, this system represents the future of Shopify theme development.
Theme blocks are Liquid files in the blocks/ directory that can be dynamically added to any section that accepts { "type": "@theme" }. They’re prefixed with an underscore (_).

Core Concepts

What Makes a Theme Block?

A theme block is defined by three characteristics:
1

Location

File must be in the blocks/ directory
2

Naming

Filename must start with an underscore: _heading.liquid, _content.liquid
3

Schema

Must include a {% schema %} tag defining settings and configuration

Theme Block vs Regular Block

blocks/_heading.liquid
Location: blocks/ directory
Usage: Can be added to ANY section with { "type": "@theme" }
Reusability: Maximum - used across multiple sections

Horizon’s Theme Blocks Catalog

Horizon includes 94 theme blocks organized into categories:

Content Blocks

Text & Headings

  • _heading.liquid - Customizable headings (h1-h6)
  • _inline-text.liquid - Inline text elements
  • _content.liquid - Nestable content groups
  • _content-without-appearance.liquid - Content without styling

Dividers & Spacing

  • _divider.liquid - Visual dividers
  • Integrated spacing controls in all blocks

Media Blocks

Images

  • _image.liquid - Responsive images
  • _media.liquid - Image/video media
  • _media-without-appearance.liquid - Media without container

Advanced Media

  • _carousel-content.liquid - Carousel items
  • _layered-slide.liquid - Layered slideshow slides
  • _hotspot-product.liquid - Interactive hotspots

Product Blocks

  • _product-card.liquid - Complete product card
  • _product-card-gallery.liquid - Product image gallery
  • _product-card-group.liquid - Grouped product cards
  • _product-details.liquid - Product information
  • _featured-product.liquid - Featured product showcase
  • _featured-product-gallery.liquid - Featured product images
  • _featured-product-price.liquid - Product pricing
  • _featured-product-information-carousel.liquid - Product info carousel
  • _product-list-content.liquid - Product list container
  • _product-list-button.liquid - Product list actions

Collection Blocks

  • _collection-card.liquid - Collection card
  • _collection-card-image.liquid - Collection image
  • _collection-image.liquid - Collection banner image
  • _collection-info.liquid - Collection information
  • _collection-link.liquid - Collection navigation link
  • _inline-collection-title.liquid - Inline collection title

Blog Blocks

  • _blog-post-card.liquid - Blog post card
  • _blog-post-content.liquid - Post content
  • _blog-post-description.liquid - Post excerpt
  • _blog-post-featured-image.liquid - Post featured image
  • _blog-post-image.liquid - Post inline image
  • _blog-post-info-text.liquid - Post metadata
  • _featured-blog-posts-card.liquid - Featured post card
  • _featured-blog-posts-image.liquid - Featured post image
  • _featured-blog-posts-title.liquid - Featured post title

Cart Blocks

_cart-products

Cart line items display

_cart-summary

Cart totals and checkout

_cart-title

Cart page heading
  • _header-logo.liquid - Site logo with responsive sizing
  • _header-menu.liquid - Main navigation menu
  • _announcement.liquid - Announcement bar item

Accordion Blocks

_accordion-row

Collapsible accordion row for FAQs and content organization

Layout Blocks

_card

Generic card container

_marquee

Scrolling marquee text

Block Architecture Patterns

1. Self-Contained Blocks

Simple blocks that render complete components:
blocks/_divider.liquid

2. Wrapper Blocks with Delegation

Blocks that delegate rendering to snippets:
blocks/_heading.liquid
The "tag": null setting prevents Shopify from wrapping the block in a container, giving full control to the snippet.

3. Nestable Container Blocks

Blocks that accept other blocks as children:
blocks/_content.liquid

Nesting and Composition

How Nesting Works

Theme blocks can be nested multiple levels deep:

Rendering Flow

1

Section renders

_blocks.liquid section starts rendering
2

content_for captures blocks

{% content_for 'blocks' %} captures all child blocks
3

First-level blocks render

_content block starts rendering
4

Nested content_for

Nested _content block calls {% content_for 'blocks' %} again
5

Nested blocks render

_image and button blocks render inside nested content
6

Bubbles up

All rendered HTML bubbles up to the section

Practical Example

Output:

Static vs Dynamic Blocks

Static Blocks

Always present, cannot be removed:
sections/header.liquid (schema)
Rendered using content_for 'block':

Dynamic Blocks

Can be added, removed, reordered by merchants:
templates/index.json
Rendered using content_for 'blocks':

Advanced Features

Context Passing

Pass data to static blocks:
sections/product-list.liquid
Access in block:
blocks/_product-card.liquid

Shopify Attributes

Preserve theme editor functionality:
blocks/_content.liquid
Always include {{ shopify_attributes }} in the root element of a block, or the theme editor won’t be able to highlight and edit the block.

Conditional Settings with visible_if

blocks/_heading.liquid (schema)

Read-only Settings

Hide settings from merchants while preserving functionality:

Creating Custom Theme Blocks

Basic Theme Block Template

blocks/_custom-block.liquid

Nestable Block Template

blocks/_custom-container.liquid

Best Practices

Each block should do one thing well. Prefer composition over monolithic blocks.Good: _heading.liquid, _image.liquid, _button.liquid
Bad: _hero-with-everything.liquid
This is critical for theme editor functionality:
Prevents Shopify’s default wrapper:
Hide irrelevant settings:
Allow blocks to inherit parent colors:

Common Patterns

blocks/_card.liquid

Pattern: Block with Media Background

blocks/_media-block.liquid

Pattern: Block with Responsive Settings

Debugging Theme Blocks

Inspecting Block Data

Visual Preview Mode Detection

Migration Guide

Converting Section Blocks to Theme Blocks

sections/hero.liquid

Performance Considerations

While nesting is powerful, excessive depth can impact render performance. Aim for 2-3 levels maximum.
Static blocks render faster than dynamic blocks since their position is predetermined.
Only loads when the block is used:

Next Steps

Theme Structure

Explore sections, snippets, and templates

Development Guide

Start building custom theme blocks

Block Reference

Browse all 94 theme blocks

Liquid Storefronts

Learn modern Liquid features