What are Blocks?
Blocks are reusable content components that can be added to sections in the Horizon theme. They provide the building blocks for creating flexible, customizable page layouts in Shopify’s theme editor.Block Categories
Layout Blocks
Layout blocks help structure and organize content:- Card - Container block with background media, overlay, and flexible content layout
- Accordion - Collapsible content panels with customizable rows
- Group - Container for grouping multiple blocks together
Product Information Blocks
Blocks that display dynamic product data:- Product Title - Displays the product name with customizable typography
- Product Description - Shows product description text
- Product Price - Displays pricing with sale price, unit price, and installments
- SKU - Shows product SKU information
- Variant Picker - Allows customers to select product variants
- Buy Buttons - Add to cart and checkout buttons
Media Blocks
Blocks for displaying visual content:- Image - Single image with aspect ratio and border controls
- Video - Video player supporting uploaded videos and external URLs
- Media - Unified media block for images or videos
Content Blocks
Blocks for text and interactive content:- Text - Rich text content with custom typography
- Button - Call-to-action button with link
- Icon - Display icon with customization options
- Spacer - Add vertical spacing between elements
Common Block Features
Schema Settings
All blocks use Shopify’s block schema to define their configurable settings. The schema includes:Nested Blocks
Many blocks support nested child blocks through the{% content_for 'blocks' %} tag:
Shopify Attributes
Blocks use{{ block.shopify_attributes }} to enable theme editor functionality:
Accessing Block Settings
Block settings are accessed viablock.settings:
Best Practices
- Use Semantic Naming - Name blocks clearly to indicate their purpose
- Provide Defaults - Always set sensible default values in the schema
- Support Inheritance - Allow blocks to inherit color schemes from parent sections
- Responsive Design - Include mobile-specific settings where appropriate
- Accessibility - Ensure blocks generate semantic HTML with proper ARIA attributes
Next Steps
- Card Block - Learn about the flexible card container
- Accordion Block - Create collapsible content panels
- Product Info Blocks - Display product information
- Media Blocks - Work with images and videos