
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeThere's a simple explanation for this! The Editor/Preview tabs you're seeing in some documents are not automatic - they're configured through the Structure Builder API using defaultDocumentNode.
By default, all documents in Sanity Studio only show the Editor tab. The Preview (or any additional tabs) appear when you explicitly configure them using the getDefaultDocumentNode function in your structure configuration.
Here's what's likely happening in your setup:
For "Articles" (with tabs): Your structure configuration probably has something like this:
export const getDefaultDocumentNode: DefaultDocumentNodeResolver = (S, options) => {
if (options.schemaType === "article") {
return S.document().views([
S.view.form(),
S.view.component(PreviewComponent).title('Preview')
])
}
}For other documents (without tabs): They're using the default behavior, which only shows the form editor.
You can configure document views in your sanity.config.ts by:
getDefaultDocumentNode function that returns different views using S.document().views()structureTool configuration:import {structureTool} from 'sanity/structure'
export default defineConfig({
plugins: [
structureTool({
defaultDocumentNode: getDefaultDocumentNode,
}),
],
})You can conditionally show preview tabs based on schemaType or documentId, which is why only certain document types have them.
For more details on setting this up, check out the Structure Builder documentation on creating custom document views.
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.
Content operations
Content backend


The only platform powering content operations
By Industry


Tecovas strengthens their customer connections
Build and Share

Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag store