Sanity Library Reference Docs
    Preparing search index...
    interface VisualEditingProps {
        basePath?: string;
        components?: OverlayComponentResolver<
            OverlayComponent<Record<string, unknown>, any>,
        >;
        history?: undefined;
        onPerspectiveChange?: (perspective: ClientPerspective) => void;
        plugins?: OverlayPluginDefinition[];
        refresh?: (payload: HistoryRefresh) => false | Promise<void>;
        trailingSlash?: boolean;
        zIndex?: string | number;
    }

    Hierarchy

    Index

    Properties

    basePath?: string

    If next.config.ts is configured with a basePath we try to configure it automatically, you can disable this by setting basePath to ''.

    basePath="/my-custom-base-path"
    @alpha experimental and may change without notice
    process.env.__NEXT_ROUTER_BASEPATH || ''
    
    components?: OverlayComponentResolver<
        OverlayComponent<Record<string, unknown>, any>,
    >

    This API is unstable and could change at any time.

    history?: undefined

    The histoy adapter is already implemented

    onPerspectiveChange?: (perspective: ClientPerspective) => void

    This event can be used to make sure server side data fetching uses the same client perspective as the Sanity Studio that is driving the visual editing.

    This API is unstable and could change at any time.

    refresh?: (payload: HistoryRefresh) => false | Promise<void>

    The refresh API allows smarter refresh logic than the default location.reload() behavior.

    trailingSlash?: boolean

    If next.config.ts is configured with a trailingSlash we try to detect it automatically, it can be controlled manually by passing a boolean.

    trailingSlash={true}
    @alpha experimental and may change without notice
    Boolean(process.env.__NEXT_TRAILING_SLASH)
    
    zIndex?: string | number

    The CSS z-index on the root node that renders overlays, tweak it accordingly to what layout you have.