Blockbench Reference Docs
    Preparing search index...
    interface ToggleOptions {
        category?: string;
        children?: any[] | ((context: any) => any[]);
        color?: string;
        condition?: ConditionResolvable;
        default?: boolean;
        description?: string;
        icon: string | (() => string);
        keybind?: Keybind;
        label?: boolean;
        linked_setting?: string;
        name?: string;
        plugin?: string;
        private?: true;
        save_on_restart?: boolean;
        searchable?: boolean;
        side_menu?: Menu | Dialog | ToolConfig;
        tool_config?: ToolConfig;
        variations?: { [key: string]: { description?: string; name: string } };
        work_in_dialog?: boolean;
        onChange?(value: boolean): void;
    }

    Hierarchy

    Index

    Properties

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

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

    default?: boolean

    Default value of the toggle

    description?: string
    icon: string | (() => string)
    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
    plugin?: string

    The plugin that this was added by

    private?: true

    If set to true, the item can only be used in private context and does not appear in keybindings, action control, or toolbar customization

    save_on_restart?: boolean

    If true, remember the value between restarts

    searchable?: boolean
    side_menu?: Menu | Dialog | ToolConfig

    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 } }
    work_in_dialog?: boolean

    Methods

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

      Parameters

      • value: boolean

      Returns void