Luxar Viewer API Documentation - v2026.9.22
    Preparing search index...

    Interface ControlRailItem

    One button in the rail.

    interface ControlRailItem {
        id: string;
        title: string;
        shortcut?: string;
        icon: string;
        activate: () => void;
        openSelector?: string;
        isActive?: () => boolean;
        momentary?: boolean;
        separatorBefore?: boolean;
        flyout?: ControlRailToggle[];
        popover?: ControlRailPopover;
        render?: (btn: HTMLButtonElement) => void;
        disabled?: () => boolean;
        hidden?: () => boolean;
    }
    Index
    id: string

    Stable id (also used as a data attribute).

    title: string

    Human-readable name, shown in the tooltip + aria-label.

    shortcut?: string

    Keyboard shortcut shown in the tooltip (display only).

    icon: string

    Inline SVG markup for the icon.

    activate: () => void

    Invoked on click — should be the same action as the shortcut.

    openSelector?: string

    CSS selector whose visible presence means this item's panel is open.

    isActive?: () => boolean

    Explicit active check (takes precedence over openSelector).

    momentary?: boolean

    Momentary action (e.g. screenshot) — never shows an active state.

    separatorBefore?: boolean

    Insert a separator before this item.

    If set, this button opens a horizontal flyout of toggles instead of firing activate. The parent button shows active when the flyout is open or any toggle inside it is active.

    If set, this button can open a vertical panel popover hosting rich controls (sliders/dropdowns), built lazily into a host element. Unlike a flyout (a row of toggle chips), a popover holds arbitrary content. The trigger decides how it opens relative to activate:

    • 'click': primary click opens the popover (activate unused).
    • 'context': right-click opens the popover; primary click still fires activate (e.g. Performance: left-click toggles the readout, right-click opens the DPR controls).
    render?: (btn: HTMLButtonElement) => void

    Optional per-refresh hook to sync the button's icon/label/tooltip from live state (e.g. the Navigation button reflecting the current control mode). Called on every ControlRail refresh with the button element.

    disabled?: () => boolean

    Optional predicate for a disabled (grayed, non-interactive) state — e.g. the Layers button when the scene has no layers. Re-evaluated on every refresh; when true the button gets the native disabled attribute so it can't be clicked or focused. Fire a refresh (see ControlRail event listeners) when the underlying condition changes.

    hidden?: () => boolean

    Optional predicate for a HIDDEN state — the button is not rendered at all (e.g. the Sound button on a scene without sound nodes), unlike disabled which grays it. Re-evaluated on every refresh.