Sanity Library Reference Docs
    Preparing search index...

    Interface DocumentInspectorBeta

    interface DocumentInspector {
        component: DocumentInspectorComponent;
        name: string;
        onClose?: (
            ctx: { params: Record<string, string> },
        ) => { params: Record<string, string> };
        onOpen?: (
            ctx: { params: Record<string, string> },
        ) => { params: Record<string, string> };
        useMenuItem?: (
            props: DocumentInspectorUseMenuItemProps,
        ) => DocumentInspectorMenuItem;
    }
    Index

    Properties

    name: string
    onClose?: (
        ctx: { params: Record<string, string> },
    ) => { params: Record<string, string> }

    Callback for when the inspector is closed, which can be used to clean up custom document pane parameters.

    onOpen?: (
        ctx: { params: Record<string, string> },
    ) => { params: Record<string, string> }

    Callback for when the inspector is opened, which can be used to set custom document pane parameters.

    Hook for defining a menu item for the inspector.