How AI is powering better personalization in e-commerce [with Vercel]. Sign up now

Understanding the "of" property in Sanity's block schema type

5 repliesLast updated: Nov 29, 2025

I'm struggling to find guides/tutorials relating to the "block" schema type using the "of" property? I seem to be missing a trick. Can anyone point me in the right direction? Thanks.

https://www.sanity.io/docs/block-type#of-d0f97ffa1dd9
AI Update

I 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:

For practical guides on working with these concepts, check out:

The 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!

Show original thread
5 replies

Was this answer helpful?

Sanity – Build the way you think, not the way your CMS thinks

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.

Related contributions