See Sanity in action 👀 Join us for a live product demo + Q&A →

Declaring Nested Lists the Block Type for PortableText

1 replies
Last updated: Jan 5, 2023
Hello, I have these nested lists,
, but I don't know how to declare the block type of these lists in order to use them in PortableText
Jan 5, 2023, 5:36 PM
I just saw I can use this:
 list: {
    // Ex. 1: customizing common list types
    bullet: ({children}) => <ul className="mt-xl">{children}</ul>,
    number: ({children}) => <ol className="mt-lg">{children}</ol>,

    // Ex. 2: rendering custom lists
    checkmarks: ({children}) => <ol className="m-auto text-lg">{children}</ol>,

Jan 5, 2023, 5:56 PM – build remarkable experiences at scale

Sanity is a customizable solution that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.

Categorized in