Sanity Library Reference Docs
    Preparing search index...

    Interface PortableTextPluginsPropsBeta

    Props for rendering Portable Text plugins

    interface PortableTextPluginsProps {
        plugins: {
            markdown?:
                | { config: MarkdownConfig; enabled?: boolean }
                | MarkdownBehaviorsConfig & {} & {
                    config?: undefined;
                    enabled?: boolean;
                };
            pasteLink?: { enabled?: boolean } & PasteLinkPluginProps;
            table?: { containers?: TableContainers; enabled?: boolean };
            typography?: { enabled?: boolean } & TypographyPluginProps;
        };
        renderDefault: (props: PortableTextPluginsProps) => Element;
    }
    Index

    Properties

    plugins: {
        markdown?:
            | { config: MarkdownConfig; enabled?: boolean }
            | MarkdownBehaviorsConfig & {} & { config?: undefined; enabled?: boolean };
        pasteLink?: { enabled?: boolean } & PasteLinkPluginProps;
        table?: { containers?: TableContainers; enabled?: boolean };
        typography?: { enabled?: boolean } & TypographyPluginProps;
    }

    Type declaration

    • Optionalmarkdown?:
          | { config: MarkdownConfig; enabled?: boolean }
          | MarkdownBehaviorsConfig & {} & { config?: undefined; enabled?: boolean }
    • OptionalpasteLink?: { enabled?: boolean } & PasteLinkPluginProps
    • Optionaltable?: { containers?: TableContainers; enabled?: boolean }

      Table editing for a table-shaped block object (table > rows > row > cells > cell > value). Unlike the other built-in plugins, tables are opt-in: the field's schema must include the table member type, and the plugin must be enabled explicitly.

      For the header-row toggle in the table menu to persist, the table type must also declare a headerRows number field; without it the toggled value is stripped from the document.

      • Optionalcontainers?: TableContainers

        Native @portabletext/plugin-table container definitions, one per role, for binding the plugin to your own type and field names (adopting a table shape that already exists in your dataset). Omitted renders fall back to the studio's table UI, and omitted roles fall back to the canonical table/row/cell names. The nesting shape and the headerRows field name stay fixed, and the schema must declare the same names the containers use.

        Define the containers at module scope: a new object identity re-registers the plugin on every render.

      • Optionalenabled?: boolean
        false
        
    • Optionaltypography?: { enabled?: boolean } & TypographyPluginProps
    renderDefault: (props: PortableTextPluginsProps) => Element