Sanity Library Reference Docs
    Preparing search index...

    Interface PortableTextProps<B>

    Properties for the Portable Text react component

    interface PortableTextProps<
        B extends TypedObject = PortableTextBlock
        | ArbitraryTypedObject,
    > {
        components?: Partial<PortableTextReactComponents>;
        listNestingMode?: ListNestMode;
        onMissingComponent?: false | MissingComponentHandler;
        value: B | B[];
    }

    Type Parameters

    • B extends TypedObject = PortableTextBlock | ArbitraryTypedObject

      Types that can appear in the array of blocks

    Index

    Properties

    components?: Partial<PortableTextReactComponents>

    React components to use for rendering

    listNestingMode?: ListNestMode

    Determines whether or not lists are nested inside of list items (html) or as a direct child of another list (direct - for React Native)

    You rarely (if ever) need/want to customize this

    onMissingComponent?: false | MissingComponentHandler

    Function to call when encountering unknown unknown types, eg blocks, marks, block style, list styles without an associated React component.

    Will print a warning message to the console by default. Pass false to disable.

    value: B | B[]

    One or more blocks to render