Partial schema reference
Learn more about partial schemas and available fields for partials.
When using HTML partials, you can create an optional schema for your partial to set field types, default values, and require inputs for variables that are passed into the partial.
Partial schemas support the following field types:
Fields
#All fields must have:
type: The type of the field to render (see below)key: A unique key for the field in the variantlabel: A label to render
Field types
#Text
#A plain text, single line text field.
Settings
#Indicates this field is required
An optional friendly description
The default value to display
The minimum length to validate
The maximum length to validate against
Example
Markdown
#A markdown editor for creating rich text. Will always be rendered as HTML.
Settings
#Indicates this field is required
An optional friendly description
The default value to display
Example
#Textarea
#A multi-line plain text area
Settings
#Indicates this field is required
An optional friendly description
The default value to display
The minimum length to validate
The maximum length to validate against
Example
#Boolean
#A checkbox that returns either true or false (checked or unchecked).
Settings
#Indicates this field is required
An optional friendly description
The default value to set
Example
#Number
#A numeric input field with optional min/max bounds and a unit label shown next to the input.
Settings
#Indicates this field is required
An optional friendly description
An optional placeholder to display in the input
The default numeric value
The inclusive minimum allowed value
The inclusive maximum allowed value
A short label shown after the input (e.g. px, kg)
Example
#Color
#A hex color input field that accepts values in #RGB or #RRGGBB format. Editors can also pick a color from the branding variables defined on the environment, in which case the value is stored as a reference to that variable (e.g. {{ vars.branding.primary_color }}).
Settings
#Indicates this field is required
An optional friendly description
An optional placeholder to display in the input
The default hex color value
Example
#Select
#A single select box that defines a static list of options for editors to pick from.
Settings
#A list of option objects that must include a label and a value
Indicates this field is required
The value of the default option to set
Example
#Usage
#In your template preview, you can access the value of the selected option using the field's key. For example:
Multi-select
#A multi-select box that defines a static list of options for editors to pick from.
Settings
#A list of option objects that must include a label and a value
Indicates this field is required
The values of the default options to set
Example
#Usage
#In your template preview, you can access the selected values using the field's key. For example:
Button
#A button, with text to display and an action to perform when clicked.
Every button field contains two subfields:
A text field that represents the button's text
A text field that represents the button's action
Settings
#Indicates this field is required
An optional friendly description
Example
#URL
#Settings
#Indicates this field is required
An optional friendly description
The default URL to display
Example
#Image
#An image field, used to display an image with alt text and an optional action to perform when clicked.
Every image field contains three subfields:
A URL field that represents the source of the image to be displayed
A text field that represents the image's alt text
An optional text field that represents an action to perform when the image is clicked
Settings
#Indicates this field is required
An optional friendly description
Example
#JSON
#A JSON input field with schema validation.
Settings
#Indicates this field is required
An optional friendly description
The default value of the JSON field
A JSON Schema object that validates the expected structure of the input. Supports properties to define the expected keys and their types, and required to specify which keys must be present.
Example
#List
#A list of items, with an optional JSON Schema that validates the structure of each item in the list.
Settings
#Indicates this field is required
An optional friendly description
The default list value
A JSON Schema object that validates the structure of each item in the list.
Example
#Usage
#When a list input is referenced in a template, its value is decoded into a Liquid array so you can iterate over it and access each item's fields.
The most common pattern is to loop over the items:
You can also access a single item by index:
Note that printing the array directly with {{ faqs }} only works when the items are primitives (strings, numbers). For lists of objects, use the json filter to render the full value:
Example usage
#Here's an example of a partial schema, and using it in a template.