
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeGreat question! You have two main options for adding headings and contextual content to organize your fields in Sanity Studio: fieldsets and field groups.
Fieldsets are perfect for what you're describing. They let you group related fields together with a title and description to provide context. Here's how to use them:
defineType({
name: 'myDocument',
type: 'document',
fields: [
defineField({
name: 'title',
type: 'string',
}),
defineField({
name: 'author',
type: 'string',
fieldset: 'metadata',
}),
defineField({
name: 'publishDate',
type: 'datetime',
fieldset: 'metadata',
}),
],
fieldsets: [
{
name: 'metadata',
title: 'Publication Metadata',
description: 'These fields control when and how this article is published',
options: { collapsible: true, collapsed: false }
}
]
})The fieldsets array is where you define your headings and descriptions, then you assign fields to a fieldset using the fieldset property. You can even make them collapsible to reduce visual clutter!
Field Groups create tabbed interfaces instead of visual sections. They're great when you have many fields and want to organize them into separate tabs:
defineType({
name: 'myDocument',
type: 'document',
groups: [
{
name: 'seo',
title: 'SEO',
description: 'Search engine optimization settings'
},
{
name: 'content',
title: 'Content'
}
],
fields: [
defineField({
name: 'metaTitle',
type: 'string',
group: 'seo',
}),
defineField({
name: 'body',
type: 'text',
group: 'content',
}),
]
})Both support titles and descriptions to give editors context about what the fields relate to. The Studio Excellence course has great examples of using both to create an excellent editorial experience.
Hope this helps! Let me know how it goes 🚀
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