Schema reference
Learn key concepts about schemas.
A schema is a structured JSON format that specifies the shape of your Content.
When you use the visual interface, a schema is automatically generated under the hood. This schema-first approach allows you to define your content visually or through a JSON file, depending on your preference.
Component
Components are reusable schemas for your content.
When you create a component, you are giving a unique name to a top-level schema, which you can then reference in other schemas.
For more information, check out our guide on Components.
Top-level schemas
Top-level schemas are those you can use to define components.
Currently, you can only create components for structures and unions. Other types, like text, number, boolean, and list, are not yet supported as top-level schemas.
Schema types
Each schema has an associated type that determines the kind of data it describes.
These are the available schema types:
- Number: Numeric values, such as prices, quantities, and percentages.
- Boolean: True or false values, such as on/off or yes/no switches.
- Text: Textual values, such as titles, descriptions, and paragraphs.
- List: Collections of items such as lists of tags, images, or products.
- Structure: A group of attributes, such as a button's label and link.
- Reference: A reference to an external schema or component.
- Union: Multiple schemas combined into a single type.
For more information about these and other types, see Schema types.
Constraints
We enforce some constraints on content schemas to ensure that components remain performant and manageable as your content model evolves.
These constraints include:
- Up to 30 attributes per structure
- Nesting up to 6 levels deep
- Maximum of 10 components in a union
- Maximum complexity score of 50.
For best practices on designing components, see our Best practices guide.