Skip to main content
A schema describes the controls and content structure that Fluid exposes in the visual editor. Place valid JSON between {% schema %} and {% endschema %} in a section or standalone block.
The schema tag does not render HTML. Your Liquid markup reads the values that an editor selects.

Define a section schema

A section schema can use these top-level fields: Use either enabled_on or disabled_on to constrain placement:

Define a setting

Every setting needs a supported type. Every value-producing setting needs a unique, non-empty id within its settings array. Use the ID to read the saved value:
Common setting fields include: Keep IDs stable after a theme ships. Changing an ID disconnects the schema from existing saved values.

Choose a setting type

Use the following value controls in section and block schemas. Where an alias is shown, use one spelling consistently within a theme.

Text and URL

Numbers and choices

A range should define its bounds and increment:
Use label and value for each explicit select or radio choice:

Visual and media

Layout

Composite controls can return structured values. Inspect the selected value before you interpolate one directly into CSS.

Organization

Use header to divide a long settings panel:
A header organizes controls. It does not create a value that you read in Liquid.

Resource selectors

Fluid resolves the following setting types into Liquid resource values: The saved identifier resolves to a resource value before Liquid reads the setting:
Use product_list when the editor should choose several products. Iterate the resolved value:

Define inline blocks

Inline blocks belong to one section. A block definition needs type and name when it defines settings.
Block settings must be an array. Duplicate block types are ambiguous and produce a validation warning. Duplicate setting IDs produce an error. Render inline blocks from section.blocks:
Standalone block references contain only type. Use @theme to accept public standalone blocks and @app to accept compatible extension blocks. See blocks and components for rendering and nesting patterns.

Add presets

A preset can provide a display name, picker category, initial settings, and initial blocks.
Use preset values that match IDs declared in the section and block schemas. A preset does not add new setting definitions.

Reuse option groups

Use an option group when several section or block settings should share a choice list defined by the root theme. This keeps choices such as type scales consistent across the editor. First, add option_group metadata to settings in config/settings_schema.json:
Each matching option_group.id contributes one choice. The editor uses option_group.label as the choice label and option_group.value as its saved value. Duplicate values are collapsed to the first matching choice. Then set options to the plain option-group ID:
Use only letters, numbers, _, and - in an option-group ID. If the group is missing or malformed, the editor cannot resolve choices for the setting. An explicit options array continues to work and takes precedence over option-group resolution.
Do not use a Liquid expression or an object in options to reference an option group. Use the plain group ID, such as "type_scale".
See root theme configuration for the rest of the settings flow.

Validate before publishing

Before you publish a schema:
  • Confirm that the schema body is valid JSON.
  • Give each value-producing setting a unique, non-empty ID.
  • Use only supported setting types.
  • Define block settings as an array.
  • Give inline blocks a name.
  • Confirm that preset values match declared IDs and block types.
  • Confirm that named standalone blocks exist.
  • Test default and edited values in the visual editor.
Run fluid theme lint --json to catch schema and reference problems before you push. See the CLI guide for the complete local workflow.