
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeYes, you can absolutely render a custom type as inline text with special formatting! What you need is an inline block object, which is different from both annotations and regular block-level objects.
Here's how to set it up:
In your schema, add your custom type to the of array inside the block definition (not at the array level):
{
name: 'content',
type: 'array',
of: [
{
type: 'block',
// This is the key - put inline objects in the block's 'of' property
of: [
{
type: 'myInlineType',
name: 'myInlineType',
title: 'My Inline Type',
fields: [
// Your document fields here
{name: 'value', type: 'string'},
{name: 'metadata', type: 'object', fields: [...]}
]
}
]
}
]
}The critical difference is:
of property → renders full-widthof property → renders inline with textThis way, your custom type will appear inline in the editor (you can insert it via the Insert menu while editing text), but you still get the full power of managing it as a proper document with all the fields you need.
You can also customize how it renders in the Studio by adding a custom inlineBlock component to control its appearance in the editor.
When rendering on the front end, you'll need to handle this inline object type in your Portable Text serializer to display it with your special formatting.
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