Sanity Library Reference Docs
    Preparing search index...

    Interface DocumentActionComponent

    interface DocumentActionComponent {
        action?: keyof DocumentActionKeys;
        displayName?: string;
        (props: DocumentActionProps): DocumentActionDescription;
    }

    Hierarchy (View Summary)

    Index

    Properties

    action?: keyof DocumentActionKeys

    Stable identifier for this action. Set to a SanityDefinedAction to replace a built-in, or to a key registered on DocumentActionKeys via declaration merging so other plugins can target the action for replacement.

    import {defineConfig} from 'sanity'
    import {MyPublishAction} from '...'

    export default defineConfig({
    document: {
    actions: (prev) =>
    prev.map((previousAction) =>
    previousAction.action === 'publish' ? MyPublishAction : previousAction,
    ),
    },
    })
    displayName?: string

    For debugging purposes