Overview
Snippets help maintain DRY (Don’t Repeat Yourself) code principles by centralizing common functionality. They can be included using therender tag:
Snippet Categories
Product Snippets (11)
Product Snippets (11)
Cart & Checkout Snippets (6)
Cart & Checkout Snippets (6)
Variant & Swatch Snippets (3)
Variant & Swatch Snippets (3)
Search Snippets (6)
Search Snippets (6)
Collection Snippets (4)
Collection Snippets (4)
Resource Snippets (5)
Resource Snippets (5)
Media Snippets (5)
Media Snippets (5)
Slideshow Snippets (5)
Slideshow Snippets (5)
Layout & Grid Snippets (7)
Layout & Grid Snippets (7)
Form Snippets (3)
Form Snippets (3)
UI Component Snippets (8)
UI Component Snippets (8)
Style Snippets (11)
Style Snippets (11)
Font & Typography Snippets (4)
Font & Typography Snippets (4)
Utility Snippets (10)
Utility Snippets (10)
Using Snippets
Basic Usage
With Multiple Parameters
Assigning Variables
Snippet Best Practices
Common Snippet Patterns
Conditional Rendering
Loop Rendering
Default Parameters
Performance Considerations
Snippets are processed on each render. For frequently used snippets:
- Cache rendered output when possible
- Minimize database queries within snippets
- Use the
{% liquid %}tag for better performance - Consider using sections for heavy components
Related Resources
Sections Reference
Sections that use snippets
Blocks Reference
Blocks that render snippets