pivotick - v2.0.1
    Preparing search index...

    Interface RailTool

    One tool in a rail mode's contextual panel — a row in the panel the mode owns.

    'default' is the tool a mode rests on when nothing special is armed (Select's Pointer); 'toggle' arms a modal tool and morphs the rail slot to match it; 'action' runs once and leaves the armed tool alone.

    interface RailTool {
        enabled?: () => boolean;
        icon: string;
        id: string;
        kind: "toggle" | "action" | "default";
        label: string;
        run?: (armed: boolean) => void;
    }
    Index

    Properties

    enabled?: () => boolean

    When it returns false the row is disabled. Re-checked on every selection change.

    icon: string

    An SVG string. It is injected with innerHTML and is not sanitised, so it must come from a source you trust. CSS sizes it to 18px in the panel.

    id: string

    Stable identity: what the store arms, and the data-tool on the row.

    kind: "toggle" | "action" | "default"
    label: string

    The row's label, used verbatim (so it can be translated).

    run?: (armed: boolean) => void

    Perform the tool's effect. A 'toggle' receives the desired armed state.