Custom input components can enable conditional fields in Sanity.io.
https://www.sanity.io/guides/how-to-make-a-custom-input-component
https://www.sanity.io/docs/custom-input-widgets
There is also this collection of components that's kinda undocumented:
https://github.com/sanity-io/sanity/tree/next/packages/%40sanity/components
They're very useful for making you custom input match the rest of the studio. The
sanity.jsonfile there can help you figure out what paths to use in your
importstatements to get those components.
https://github.com/sanity-io/sanity-recipes/blob/master/snippets/conditionalFieldsCustomInputComponent.js
Was this answer helpful?
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.