Skip to content

Sections

Sections are reusable, customizable areas of a page. They hold the markup, styles, and scripts for one part of a storefront, along with a JSON schema that lets sellers configure them from the theme editor.

Location

Sections live in the sections directory of the theme, one .liquid file per section.

bash
└── theme
    ├── layout
    ├── sections
   ├── header.liquid
   ├── featured-products.liquid
   ├── footer.liquid
   ...
    ...

Content

Sections can contain three main types of content:

TypeDescriptionRequired
Main contentAny HTML or Liquid content you want to render. Sections have the same access to global objects, tags, and filters as other Liquid theme files, plus the section-specific section and block objects.No
AssetsJavaScript and CSS bundled with the section through the {% javascript %} and {% style %} tags. See JavaScript and styles.No
SchemaA single {% schema %} tag defining the section's attributes and settings: label, tag, limit, settings, blocks, and max_blocks. See Section schema.Yes

Content

When working with sections, you should familiarize yourself with How to render a section

Rendering sections

You can render sections in one of the following ways:

Statically render a section

You can statically render a section using the Liquid section tag.

liquid
{% section 'header' %}

To let sellers configure a section's child items from the theme editor, see Blocks.