
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeYes, you can control both the blank option and set a default value for a string field with a list in options!
When you use a list option with layout: 'dropdown', Sanity shows a blank option by default. To avoid this, you have two options:
Use radio buttons instead: Set layout: 'radio' in your options. This removes the blank dropdown option entirely.
Set an initial value: Use the initialValue property to pre-select a specific option.
Use the initialValue property on your field to set which option is selected by default:
{
title: 'Genre',
name: 'genre',
type: 'string',
options: {
list: [
{title: 'Sci-Fi', value: 'sci-fi'},
{title: 'Western', value: 'western'}
],
layout: 'dropdown' // or 'radio'
},
initialValue: 'sci-fi' // Sets Sci-Fi as the default
}Here's a field configuration that avoids the blank option and sets a default:
{
title: 'Genre',
name: 'genre',
type: 'string',
options: {
list: [
{title: 'Sci-Fi', value: 'sci-fi'},
{title: 'Western', value: 'western'},
{title: 'Drama', value: 'drama'}
],
layout: 'radio' // No blank option with radio buttons
},
initialValue: 'sci-fi' // Sci-Fi selected by default
}The initialValue works with both dropdown and radio layouts. When using radio buttons, the specified value will be pre-selected. With dropdowns, it will show that value instead of a blank option when creating new documents.
You can find more details in the string type documentation and the initial values guide.
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