Sanity Library Reference Docs
    Preparing search index...

    Interface DocumentPluginOptionsBeta

    interface DocumentPluginOptions {
        actions?: DocumentActionComponent[] | DocumentActionsResolver;
        askToEdit?: {
            enabled:
                | boolean
                | ((context: DocumentAskToEditEnabledContext) => boolean);
        };
        badges?: DocumentBadgeComponent[]
        | DocumentBadgesResolver;
        drafts?: { enabled?: boolean };
        inspectors?: DocumentInspector[] | DocumentInspectorsResolver;
        newDocumentOptions?: NewDocumentOptionsResolver;
        productionUrl?: AsyncComposableOption<string, ResolveProductionUrlContext>;
        unstable_comments?: {
            enabled:
                | boolean
                | ((context: DocumentCommentsEnabledContext) => boolean);
        };
        unstable_languageFilter?: DocumentLanguageFilterResolver;
    }
    Index

    Properties

    askToEdit?: {
        enabled:
            | boolean
            | ((context: DocumentAskToEditEnabledContext) => boolean);
    }

    Configuration for the "Ask to edit" button that appears when a user lacks edit permissions on a document.

    Type declaration

    • enabled: boolean | ((context: DocumentAskToEditEnabledContext) => boolean)

      Whether the "Ask to edit" button is enabled. Defaults to true.

      Can be a boolean or a function that receives a context object and returns a boolean. When set to false, the "Ask to edit" button will be hidden but the document will still be read-only for users without edit permissions.

    drafts?: { enabled?: boolean }

    Type declaration

    • Optionalenabled?: boolean

      Whether the workspace provides the draft model for interacting with documents.

      When switched off, documents may only be edited:

      • Inside a release.
      • Outside a release if they support live-edit.
    newDocumentOptions?: NewDocumentOptionsResolver
    unstable_comments?: {
        enabled:
            | boolean
            | ((context: DocumentCommentsEnabledContext) => boolean);
    }

    Use comments instead

    unstable_languageFilter?: DocumentLanguageFilterResolver