Field Notes
    Preparing search index...

    Interface ViewportOptions

    interface ViewportOptions {
        assets?: AssetResolver;
        background?: BackgroundOptions;
        camera?: CameraOptions;
        contextMenu?: boolean;
        elementRegistry?: ElementRegistry;
        embedded?: boolean;
        fontSizePresets?: FontSizePreset[];
        minimap?: boolean;
        onDrop?: (
            event: DragEvent,
            worldPosition: { x: number; y: number },
        ) => boolean | void;
        onHtmlElementMount?: (
            elementId: string,
            domId: string | undefined,
            container: HTMLDivElement,
        ) => void;
        onImageError?: (info: ImageErrorInfo) => void;
        onOpenLink?: (link: string, event: PointerEvent | null) => boolean | void;
        onPaste?: (
            event: ClipboardEvent,
            worldPosition: { x: number; y: number },
        ) => boolean | void;
        palette?: false | PaletteOptions;
        panBufferMargin?: number;
        panInertia?: boolean;
        placeholder?: string;
        plugins?: ViewportPlugin[];
        requiredCapabilities?: RequiredCapabilities;
        selectionColor?: string;
        shortcuts?: ShortcutOptions;
        theme?: Theme;
        toolbar?: boolean;
        tools?: "default" | Tool[];
    }
    Index
    assets?: AssetResolver

    Host upload for dropped, pasted and imported images; without it images inline as base64.

    background?: BackgroundOptions
    camera?: CameraOptions
    contextMenu?: boolean

    Enable the built-in context menu. Default true.

    elementRegistry?: ElementRegistry

    Element type registry; defaults to a per-viewport registry layered over the global default.

    embedded?: boolean

    Board inside a scrolling page: plain wheel and, until setEmbeddedEngaged(true), touch scroll the page; Ctrl/⌘+wheel zooms; mouse and pen work as usual. Input only, read at construction. Not gated: setActivation, the minimap, PingInput and CameraAnimator. Default false.

    fontSizePresets?: FontSizePreset[]
    minimap?: boolean

    Show an overview minimap (bottom-right) with tap/drag-to-navigate. Default false.

    onDrop?: (
        event: DragEvent,
        worldPosition: { x: number; y: number },
    ) => boolean | void

    Called for every drop before core acts; return false to let core handle the drop. true or nothing means the host owns it.

    onHtmlElementMount?: (
        elementId: string,
        domId: string | undefined,
        container: HTMLDivElement,
    ) => void
    onImageError?: (info: ImageErrorInfo) => void
    onOpenLink?: (link: string, event: PointerEvent | null) => boolean | void

    Called before every link open; return true to handle it yourself, for example cross-board navigation. event is the last pointer event seen (it may be a pointermove), or null for keyboard, menu and command palette opens.

    onPaste?: (
        event: ClipboardEvent,
        worldPosition: { x: number; y: number },
    ) => boolean | void

    Called for every paste core would handle, before core acts; return false to let core handle it. true or nothing means the host owns the paste.

    palette?: false | PaletteOptions

    Command palette and shortcuts help. false removes both and their actions. Default enabled.

    panBufferMargin?: number

    CSS-pixel margin cached beyond the viewport. Default 256. Set 0 to disable.

    panInertia?: boolean

    Coast (inertial glide) after a pan flick. Default true.

    placeholder?: string
    plugins?: ViewportPlugin[]

    Domain plugins to install. Each plugin self-wires via the host API.

    requiredCapabilities?: RequiredCapabilities

    Render capabilities that must remain installed after optional-plugin rollback.

    selectionColor?: string

    Colour of selection outlines, handles, marquee, lock badges, binding highlights and arrow previews. Default #2196F3.

    shortcuts?: ShortcutOptions
    theme?: Theme

    Board theme. Default 'light'; 'system' follows the system preference.

    toolbar?: boolean
    tools?: "default" | Tool[]

    Tools registered after plugins start, replacing same-named plugin tools; activates select when present. If a plugin activated a tool that an option tool replaces, the plugin's instance stays active.