
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeYes, it is possible to have a custom icon for each section in your rich text editor! Based on the documentation, you can add custom icons to block types in your Sanity schema.
When defining custom block types in your Portable Text array, you can specify an icon property. Here's how:
{
title: 'Rich text',
type: 'array',
of: [
{type: 'block'},
{
type: 'myCustomSection',
icon: MyCustomIcon // Your custom icon component
},
{
type: 'anotherSection',
icon: AnotherIcon
}
]
}Sanity provides a comprehensive icon library through @sanity/icons. You can import and use these icons:
import {DocumentIcon, ImageIcon} from '@sanity/icons'
{
title: 'Content sections',
type: 'array',
of: [
{type: 'block'},
{
type: 'textSection',
icon: DocumentIcon
},
{
type: 'imageSection',
icon: ImageIcon
}
]
}You can also create your own icon components. The icon property accepts a React component:
{
type: 'specialSection',
icon: () => <span style={{fontSize: '1.5em'}}>⭐</span>
}The icons will appear in the Insert menu and toolbar of the Portable Text Editor, making it easy for content editors to identify and insert different section types. Note that these icon customizations only affect how content appears in the Studio interface - they won't affect how the content is rendered on your frontend (that's handled separately through portable text serialization).
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