interface ToolbarParams {
    container?: HTMLElement;
    onAction?: (
        action: ToolbarAction,
        ctx: { mode?: ToolbarToolMode; toolbar: Toolbar; viewer: Viewer },
    ) => boolean | void;
    storageKey?: string;
    studio?: Studio;
    viewer: Viewer;
    visible?: boolean;
}

Properties

container?: HTMLElement

DOM container; defaults to document.body.

onAction?: (
    action: ToolbarAction,
    ctx: { mode?: ToolbarToolMode; toolbar: Toolbar; viewer: Viewer },
) => boolean | void

Optional override called instead of the toolbar's built-in action handler. Returning false (or undefined) lets the built-in handler also run; returning true short-circuits the default behaviour. Useful when a host wants to customise Reset / Fit All / Explorer toggle without forking the whole toolbar.

storageKey?: string

localStorage key for persisting drag position + closed state. Defaults to "xkt-tb-toolbar".

studio?: Studio

Optional Studio. Used by Fit-All / Reset-View to read the Scene's overall AABB out of the helper's collision index; without it the camera-framing buttons fall back to a console-warn no-op.

viewer: Viewer

Viewer the toolbar drives. Camera / projection actions read the active View off this Viewer; doubles as the WeakMap key for Toolbar.openFor idempotence — one toolbar per Viewer.

visible?: boolean

Show on construction (default true).