Inline Schemas
Inline schemas let you create reusable content components that can be embedded inside other models. Think of them as custom building blocks — once you create one, it appears as a field type you can add to any model.
Overview
An inline schema is a model whose fields can be embedded directly within another record’s data, rather than existing as a separate record with its own ID. For example:
- A Hero Banner with heading, image, and call-to-action button
- A Testimonial Card with quote, author name, and photo
- A Feature Block with icon, title, and description
Once created, these appear alongside the built-in field types (text, number, image, etc.) when adding fields to any model.
How It Works
- Create a model with the fields your component needs
- Enable Inline Mode on the model
- The model’s key now appears as a field type in other models
- When editors fill in that field, they see a structured form matching the inline schema
Mode Options
Models have three options for how they can be used:
Inline Only — Can be embedded in other content, but cannot be created as standalone records. Best for components like buttons, cards, and hero banners.
Standalone Only — Creates individual records managed separately. This is the default for all models. Best for pages, blog posts, and products.
Both Inline and Standalone — Can be embedded inside other models or managed as separate records. Best for reusable sections you want to manage centrally and also embed elsewhere.
In the Admin
Creating an inline schema
- Go to Settings > Models
- Click Create Model
- Fill in the details:
- Name: “Hero Banner”
- Key:
hero-banner(auto-generated from name)
- Add fields:
- Heading (text, required)
- Subheading (text)
- Background Image (image)
- Button Text (text)
- Button URL (text)
- Enable Inline Mode in the model settings
- Click Save
Using an inline schema as a field
- Edit any model (e.g., Page)
- Click Add Field
- In the field type dropdown, you will see your inline schemas listed alongside built-in types:
- Hero Banner
- Testimonial Card
- Feature Block
- Select one and configure the field (label, required, help text)
Now when editing records of that model, editors see a structured form for the inline component.
Nesting Components
Inline schemas can contain other inline schemas, allowing you to build complex layouts from simple pieces:
Feature Grid
-- Heading (text)
-- Features (array of Feature Card)
-- Icon (image)
-- Title (text)
-- Description (textarea)Page
-- Hero (Hero Banner)
-- Sections (array of Page Section)
-- Section Type (select)
-- Feature Grid (Feature Grid)
-- Testimonials (array of Testimonial Card)
-- CTA (CTA Section)Common Patterns
Page Sections
Create reusable page sections that editors can mix and match:
| Component | Fields |
|---|---|
| Hero Banner | Heading, subheading, background image, CTA button |
| Feature Grid | Heading, list of feature cards |
| Testimonials | Heading, list of testimonial cards |
| CTA Section | Heading, description, button |
Cards
Create consistent card layouts used across multiple models:
| Component | Fields |
|---|---|
| Product Card | Image, title, price, link |
| Team Member | Photo, name, role, bio |
| Blog Preview | Image, title, excerpt, date |
UI Elements
Create standardized, reusable UI components:
| Component | Fields |
|---|---|
| Button | Text, URL, style variant, size |
| Link | Text, URL, open in new tab |
| Badge | Text, color |
Inline Schemas in Content Fields
Inline schemas double as block types for the content field. When a content field is rendered, every block in the document is an instance of an inline-schema model — same definition, just embedded inline rather than stored as a standalone record.
Two effects:
- Adding fields to an inline schema adds them to every block of that type. A
Heromodel withheadline,subheadline, andimageUrlbecomes aHeroblock with the same three fields available everywhere aHerois used. - Restricting blocks to a subset. By default, every inline-mode model is available as a block. To restrict, set
config.blockson the content field:
{
"key": "body",
"type": "content",
"label": "Body",
"config": {
"blocks": ["hero", "feature-grid", "testimonial-card"]
}
}Resolved shape
Each inline-schema block in a resolved content field is a typed segment with _type set to the model key:
{
"_type": "hero",
"_id": "block-abc123",
"headline": "Welcome",
"subheadline": "...",
"image": { "url": "https://...", "width": 1920, "height": 1080, "alt": "..." }
}Field values are resolved through the normal pipeline — image fields return full ImageValue objects, references return resolved record data, and so on.
MediaBlock and ReferenceBlock
The platform registers two built-in block primitives that don’t need an inline-schema model:
MediaBlock— embedded image/video/file. Resolved with the per-usage alt text and the file’s full metadata.ReferenceBlock— reference to another record. Resolves to aRecordunion you can type-narrow against your project’s models inline.
These primitives are always available regardless of config.blocks. They handle the cross-cutting cases (media embeds, record references) so you don’t need a per-project inline schema for them.
Best Practices
- Keep components focused. Each inline schema should do one thing well.
- Use clear names. The name appears in the field type selector, so editors need to understand what each component is for.
- Add descriptions to help editors know when to use each component.
- Start simple and add fields as needed. Removing fields later is harder than adding them.
- Watch nesting depth. More than two or three levels of nesting can make the editing experience confusing.
- Use inline-only mode for components that should never exist on their own (buttons, badges, cards).