Sanity Library Reference Docs
    Preparing search index...

    Interface BlockDecoratorProps

    Props for rendering text decorations in Portable Text blocks. It could be decorations like bold, italic, subscript etc.

    interface BlockDecoratorProps {
        children: Element;
        focused: boolean;
        renderDefault: (props: BlockDecoratorProps) => Element;
        schemaType: BlockDecoratorDefinition;
        selected: boolean;
        title: string;
        value: string;
    }
    Index

    Properties

    children: Element

    The span node as rendered without the decorator.

    focused: boolean

    If the span node currently is focused by the user.

    renderDefault: (props: BlockDecoratorProps) => Element

    The default render function for this decorator, some decorators are proved by default and has a default rendering.

    The decorator schema type. Icon can be found here.

    selected: boolean

    If the span node text currently is selected by the user.

    title: string

    The title of the decorator (e.g. 'Underlined text') for UI-representation.

    value: string

    The value of the decorator (e.g. 'underlined') as it appears in the child.marks array of the text node.