
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeBased on your mockup, it sounds like you're looking for fieldsets! This is exactly the feature that lets you create those visual sub-categories/groupings within your document schema.
Fieldsets allow you to group related fields together under a collapsible section without changing your data structure. Here's how to set them up:
export default {
name: 'myDocument',
type: 'document',
title: 'My Document',
fieldsets: [
{
name: 'seoGroup',
title: 'SEO Settings',
options: {
collapsible: true, // Makes it collapsible
collapsed: false // Set to true if you want it collapsed by default
}
},
{
name: 'mediaGroup',
title: 'Media',
options: {
collapsible: true,
collapsed: true
}
}
],
fields: [
{
name: 'title',
type: 'string',
title: 'Title'
},
{
name: 'metaTitle',
type: 'string',
title: 'Meta Title',
fieldset: 'seoGroup' // Assigns this field to the SEO fieldset
},
{
name: 'metaDescription',
type: 'text',
title: 'Meta Description',
fieldset: 'seoGroup'
},
{
name: 'featuredImage',
type: 'image',
title: 'Featured Image',
fieldset: 'mediaGroup'
}
]
}The key parts are:
fieldsets array at the document levelfieldset: 'yourFieldsetName'options object to control collapsibility and default stateYou can also arrange fields in columns within a fieldset by adding columns: 2 to the options. Check out the guide on creating effective editor experiences for more tips on organizing your schemas!
Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.
Content operations
Content backend


The only platform powering content operations
By Industry


Tecovas strengthens their customer connections
Build and Share

Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag store