RD Pennell
Community Engineer at Sanity.io
Prefer to have no image next to your array items? This can help!
This schema is for an older version of Sanity Studio (v2), which is deprecated.
Learn how to migrate to the new Studio v3 →// import React at the top of the document
preview: {
select: {
title: // your title field,
subtitle: // your subtitle field
},
prepare({ title, subtitle }) {
return {
title: title,
subtitle: subtitle,
media: <span />
}
}
}
The icon for an item in an array is based off of the preview in that item’s schema and can be customized using Previews/List Views.
Completely removing the icon isn't as straightforward, though (since setting media
to null or an empty string defaults back to the original icon). If you're set on having no icon at all rendering an empty span or div can get you there.
Community Engineer at Sanity.io
Use the renderDefault method to show or hide fields.
Go to Conditionally show a field based off of a value inside of a referenceThis will allow you to display an array of references as a checklist from which you can multi-select.
Go to V3 version of Display an array of references as a checklistPopulate your list options in a string schema using an external API
Go to Asynchronous List Options ComponentUse the renderDefault function to easily control your available array options.
Go to Filter Array Options Based on the Current User Role