Set default value for string list options in Sanity schema

22 replies
Last updated: Jan 28, 2026
Hi. I am trying to add a string type with a list in options. Is there a way to avoid a blank option in the dropdown by default and also set a specific option as the default selected option?
AI Update

Yes, you can control both the blank option and set a default value for a string field with a list in options!

Avoiding the blank option

When you use a list option with layout: 'dropdown', Sanity shows a blank option by default. To avoid this, you have two options:

  1. Use radio buttons instead: Set layout: 'radio' in your options. This removes the blank dropdown option entirely.

  2. Set an initial value: Use the initialValue property to pre-select a specific option.

Setting a default selected 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
}

Complete example

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.

Show original thread
22 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.

Was this answer helpful?