
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeNo worries about asking an "old question" – this comes up fairly often! The solution is to create a custom input component that displays static text without actually rendering an editable field.
The approach from that linked answer page is still valid. Here's the basic idea:
1. Create a custom input component that just displays your text:
// components/IntroTextComponent.js
import React from 'react'
import {Card, Text} from '@sanity/ui'
export default function IntroText(props) {
const {type} = props
const {intro} = type.options || {}
return (
<Card padding={3} radius={2} shadow={1}>
<Text>{intro}</Text>
</Card>
)
}2. Add it to your schema with the text you want to display:
import IntroTextComponent from './components/IntroTextComponent'
export default {
name: 'myDocument',
type: 'document',
fields: [
{
name: 'welcomeText',
title: 'Welcome',
type: 'string',
components: {
input: IntroTextComponent
},
options: {
intro: 'Hello!\n\nThis is the homepage, where you can edit the main content.'
},
hidden: true // Optional: hides it from the field list
},
// ... your other fields
]
}Note for Studio v3: The syntax has changed slightly from the old answer. You now use components: { input: YourComponent } instead of inputComponent.
You can make this more sophisticated by:
intro option for formatted textprops.value or other field valuesIf you want the text to appear but not take up space in the document data, you can also set hidden: true on the field, or use readOnly: true with an initialValue if you need it stored but not editable.
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