Sanity: Possibility to render fields based on conditions (computed fields)

Created on 16 Mar 2018  路  9Comments  路  Source: sanity-io/sanity

It would be great to add the possibility to render parts of a form based on values of certain fields.

E.g. imagine you have form with a few bool switches: Language: EN, Language: NL, ...
When these bools are enabled we render specific fields related to that language (title, body, etc.).

Feature Request Studio

Most helpful comment

My team really would benefit from this as well. We use Sanity for lots of large client projects and our designers (I'm one of them) worry that the UX of Sanity degrades as more fields are added and nested. Being able to "progressively disclose" fields conditionally based on, for example, a switch, radio, or dropdown, would reduce end-user cognitive load and make the CMS feel snappier and more focused.

All 9 comments

Great suggestion. There's no time to prioritize it right now, but I'll add it to our backlog.

That would be very useful

Need this feature too. In my case I have "Is a gallery" switch. Depending on its state I need to toggle Block and Images fields.

My team really would benefit from this as well. We use Sanity for lots of large client projects and our designers (I'm one of them) worry that the UX of Sanity degrades as more fields are added and nested. Being able to "progressively disclose" fields conditionally based on, for example, a switch, radio, or dropdown, would reduce end-user cognitive load and make the CMS feel snappier and more focused.

Any development on this feature @evenwestvang ?

Really need this feature. We want to show different sets of categories based on previous selection.

Also running into this particular use case. We want to show/hide a set of an object's fields depending on a boolean.

This should look like this right!!!

I would like to contribute to this feature. I am just figuring out to understand the codebase.

Suggestion: We have two fields e.g In One for show fields (boolean) and another array of fields that we want to show on based on the former boolean value.

Untitled-2020-07-26-1717

Would love this feature, any progress being made on this? Going to try to implement this in the mean time https://gist.github.com/kmelve/e34feccafe8e9ee3c7e09d60ee3fd4d2

Was this page helpful?
0 / 5 - 0 ratings