Array schema layout options in Sanity (tags, grid, radio, dropdown, etc.)
Great question! The layout options are spread across different schema types, so let me break down what's actually available:
For Array Types
Arrays do have built-in layout options according to the official documentation:
'tags'- Renders the array as a single, tokenized input field (like tags). Important: This only works if the array contains strings.'grid'- Displays array items in a grid layout.
When using the list option (predefined values), you can also set:
'vertical'(default) - Displays checkboxes in a column'grid'- Displays checkboxes horizontally
Example with tags layout:
{
title: 'Tags',
name: 'tags',
type: 'array',
of: [{type: 'string'}],
options: {
layout: 'tags'
}
}Example with grid layout:
{
title: 'Items',
name: 'items',
type: 'array',
of: [{type: 'object', ...}],
options: {
layout: 'grid'
}
}For String and Number Types with options.list
When you have a string type or number type with a predefined list of values, you get these layout options:
'dropdown'(default) - Shows a dropdown/select menu'radio'- Shows radio buttons
You can also control the direction of radio buttons:
'vertical'(default)'horizontal'
Example:
{
name: 'genre',
type: 'string',
options: {
list: [
{title: 'Sci-Fi', value: 'sci-fi'},
{title: 'Western', value: 'western'}
],
layout: 'radio', // or 'dropdown'
direction: 'horizontal' // only works with radio
}
}No Other Built-in Options
Unfortunately, there aren't other built-in layout options like a standalone 'multi-select' or additional dropdown variants. The complete list is:
- Arrays:
tags,grid, or default list view - String/Number with list:
dropdownorradio
Need Something More Custom?
If you need specialized layouts beyond these options, you have a few paths:
- Custom input components - Arrays and other types support extensive customization through the
componentsproperty where you can provide custom input components using Sanity UI components - Plugin ecosystem - Check the Sanity plugin directory for pre-built solutions
- Array of strings - For multi-select functionality, an array of strings with checkboxes (using the
listoption) works well
Hope that clears things up!
Show original thread3 replies
Sanity – Build the way you think, not the way your CMS thinks
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.