How to display ordered/unordered lists in Portable Text editor?

8 replies
Last updated: Jan 27, 2026
Hi everyone and thanks for a very sane CMS solution! I have a question about Portable text editor and showing of ol/ul lists.
AI Update

Glad to hear you're enjoying Sanity! When it comes to showing ordered (ol) and unordered (ul) lists in the Portable Text editor, you have full control over the list configuration in your schema.

Default List Configuration

By default, the Portable Text editor includes both bullet (unordered) and numbered (ordered) lists. They appear as toolbar buttons in the editor:

export default {
  name: 'content',
  type: 'array',
  of: [
    {
      type: 'block',
      // Lists are enabled by default
    }
  ]
}

Customizing Lists

You can explicitly configure which lists are available using the lists property:

export default {
  name: 'content',
  type: 'array',
  of: [
    {
      type: 'block',
      lists: [
        {title: 'Bullet', value: 'bullet'},
        {title: 'Numbered', value: 'number'}
      ]
    }
  ]
}

To disable lists entirely, just pass an empty array:

lists: [] // no lists

To enable only one type, just include that one:

lists: [
  {title: 'Bullet', value: 'bullet'}
] // only unordered lists

You can also customize the titles that appear in the editor - for example, {title: 'Prioritized', value: 'number'} works just fine!

Rendering Lists

When rendering your Portable Text content on the frontend using @portabletext/react, lists are automatically rendered as <ul> and <ol> elements. You can customize this with custom serializers if needed.

More details can be found in the Configuring lists for text blocks section of the documentation.

Show original thread
8 replies

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.

Was this answer helpful?