Customizing reference field preview in array schema without modal
I understand your situation! Unfortunately, there isn't a documented way to skip the modal and navigate directly to the referenced document's pane from a custom preview component in array items.
The behavior you're experiencing is the standard Studio workflow: clicking an array item opens the editing modal for that item, and then you need to click the reference field within that modal to open the referenced document in a new pane. This is by design in the Form Components API.
What You Can Customize
While you can customize the appearance of array items using custom preview components (via the components.preview or components.item property), these components are primarily for visual presentation. Based on the available documentation, they don't expose navigation APIs that would allow you to programmatically open document panes and bypass the modal.
The custom components you can create for arrays include:
- Preview components - Control how collapsed array items display
- Item components - Customize the appearance of array items in the list
- Input components - Replace the entire editing interface for the array item
However, none of these component types provide documented hooks or utilities to directly manipulate Studio's pane navigation system.
Recommended Workaround
If your object truly contains only a single reference field and nothing else, you might consider restructuring your schema to use an array of references directly instead:
defineField({
name: 'myArray',
type: 'array',
of: [{
type: 'reference',
to: [{type: 'yourDocumentType'}]
}]
})With this structure, clicking items in the array will immediately open the referenced document in a new pane, skipping the intermediate modal entirely since there's no object wrapper.
If you need to keep the object wrapper for other reasons (like adding metadata fields later, or if you're using it for organizational purposes), you're currently limited to the standard two-click workflow: first click opens the object modal, second click opens the referenced document.
This is a common pain point when working with reference-heavy schemas, and while the custom preview makes the visual experience better, the navigation behavior itself remains unchanged. The simplest solution is to flatten your schema to use direct references if possible.
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.