
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeI totally get the confusion here! The of property in the block schema can be a bit tricky because it's used in two different contexts, and the documentation doesn't always make this super clear.
When you define a Portable Text field, you're actually creating an array that can contain blocks and other content types. The of property at the array level defines what types can be in that array (like {type: 'block'}, {type: 'image'}, etc.).
But then the block type itself also has an of property! This is where it gets interesting. The of property on the block type defines inline objects - custom content that appears within your text paragraphs, not as separate blocks.
Here's a practical example:
defineField({
name: 'content',
type: 'array',
of: [
{
type: 'block',
// This 'of' defines inline objects within text
of: [
{
type: 'object',
name: 'inlineProduct',
fields: [
{name: 'productId', type: 'string'}
]
}
],
// 'marks' defines annotations (like links)
marks: {
annotations: [
{
name: 'link',
type: 'object',
fields: [
{name: 'href', type: 'url'}
]
}
]
}
},
{type: 'image'} // This is a separate block, not inline
]
})The key distinction:
block.of) appear within text spans - think of them like inline components embedded in a paragraphblock.marks.annotations) are decorators on text selections - like links, highlights, or citationsof) are separate content blocks that sit between paragraphsFor practical guides on working with these concepts, check out:
of propertyThe inline objects feature (that of property on blocks) is less commonly documented because annotations are usually the better choice for most inline use cases. If you're trying to add something like inline links or citations, you'll want to use annotations instead!
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