
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeBased on the documentation I found, yes, there is a way to add line breaks to field descriptions in Sanity Studio! The description property in defineField supports JSX formatting when you're using .jsx or .tsx file extensions.
Instead of trying to use HTML strings with <br /> (which gets escaped as you discovered), you can write the description as JSX elements. Here's how:
defineField({
name: 'myField',
type: 'string',
title: 'My Field',
description: (
<>
This is the first line of the description.
<br />
This is the second line after a line break.
<br />
And here's a third line!
</>
)
})You can also use more complex JSX structures. The Sanity documentation on schema definitions shows an example using collapsible details:
description: (
<details>
<summary>Why is this important?</summary>
The Googlebot is an indexer of...
</details>
)Important: This JSX approach only works when your schema file has a .jsx or .tsx extension. If you're using plain .js files, you'll need to rename them to .jsx or .tsx to enable JSX syntax.
If for some reason you can't use JSX, you could also use the newline character \n in a plain string, though the rendering might not be as clean:
description: 'This is the first line.\nThis is the second line.'The JSX approach is definitely the recommended way to format descriptions with line breaks and other formatting in Sanity Studio!
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