Blockbench Reference Docs
    Preparing search index...

    Interface ToggleOptions

    interface ToggleOptions {
        category?: string;
        children?: any[] | (() => any[]);
        color?: string;
        condition?: any;
        default?: boolean;
        description?: string;
        icon: string | (() => selected_layer);
        keybind?: Keybind;
        label?: boolean;
        linked_setting?: string;
        name?: string;
        side_menu?: Menu;
        tool_config?: ToolConfig;
        variations?: { [key: string]: { description?: string; name: string } };
        onChange?(value: boolean): void;
    }

    Hierarchy

    Index

    Properties

    category?: string
    children?: any[] | (() => any[])
    color?: string

    Icon color. Can be a CSS color string, or an axis letter to use an axis color.

    condition?: any
    default?: boolean

    Default value of the toggle

    description?: string
    icon: string | (() => selected_layer)
    keybind?: Keybind
    label?: boolean

    Show the full label in toolbars

    linked_setting?: string

    ID of a setting that the toggle is linked to

    name?: string
    side_menu?: Menu

    Provide a menu that belongs to the action, and gets displayed as a small arrow next to it in toolbars.

    tool_config?: ToolConfig

    Provide a window with additional configutation related to the action

    variations?: { [key: string]: { description?: string; name: string } }

    Methods

    • Method that gets called when the user changes the value of the toggle

      Parameters

      • value: boolean

      Returns void