Blockbench Reference Docs
    Preparing search index...
    interface ConfigDialogOptions {
        buttons?: string[];
        cancel_on_click_outside?: boolean;
        cancelIndex?: number;
        component?: Component;
        confirmIndex?: number;
        darken?: boolean;
        draggable?: false;
        form?: InputFormConfig;
        form_first?: boolean;
        icon?: string;
        id?: string;
        keyboard_actions?: {
            [id: string]: {
                condition?: any;
                keybind: Keybind;
                run: (event: KeyboardEvent) => void;
            };
        };
        lines?: DialogLineOptions[];
        part_order?: string[];
        progress_bar?: { progress?: number };
        resizable?: boolean | "x" | "y" | "xy";
        sidebar?: DialogSidebarOptions;
        singleButton?: boolean;
        title: string;
        title_menu?: Menu;
        toolbars?: Record<string, Toolbar>;
        width?: number;
        onBuild?(): void;
        onButton?(button_index: number, event?: Event): boolean | void;
        onCancel?(event: Event): boolean | void;
        onClose?(button_index: number, event?: Event): boolean | void;
        onConfirm?(formResult: any, event: Event): boolean | void;
        onFormChange?(form_result: { [key: string]: FormResultValue }): void;
        onOpen?(): void;
        onResize?(): void;
    }

    Hierarchy (View Summary)

    Index

    Properties

    buttons?: string[]

    List of buttons

    cancel_on_click_outside?: boolean

    Unless set to false, clicking on the darkened area outside of the dialog will cancel the dialog.

    cancelIndex?: number

    Default button to press to cancel the dialog. Defaults to the last button.

    component?: Component

    Vue component

    confirmIndex?: number

    Default button to press to confirm the dialog. Defaults to the first button.

    darken?: boolean

    Create a dark backdrop behind the dialog

    draggable?: false

    Set to false to stop the dialog from being dragged around

    form?: InputFormConfig

    Creates a form in the dialog

    form_first?: boolean
    icon?: string
    id?: string
    keyboard_actions?: {
        [id: string]: {
            condition?: any;
            keybind: Keybind;
            run: (event: KeyboardEvent) => void;
        };
    }

    A list of keyboard shortcuts that only work inside the dialog

    lines?: DialogLineOptions[]

    Array of HTML any strings for each line of content in the dialog.

    part_order?: string[]

    Order that the different interface types appear in the dialog. Default is 'form', 'lines', 'component'.

    progress_bar?: { progress?: number }

    Display a progress bar in the dialog

    Type Declaration

    • Optionalprogress?: number

      A progress value between 0 and 1

    resizable?: boolean | "x" | "y" | "xy"

    Select on which axes the dialog can be resized. None by default

    Creates a dialog sidebar

    singleButton?: boolean

    If true, the dialog will only have one button to close it

    title: string
    title_menu?: Menu

    Menu in the handle bar

    toolbars?: Record<string, Toolbar>
    width?: number

    Methods

    • Runs when the dialog is built

      Returns void

    • Triggered when the user presses a specific button

      Parameters

      • button_index: number
      • Optionalevent: Event

      Returns boolean | void

    • Function to execute when the user cancels the dialog

      Parameters

      Returns boolean | void

    • Triggered when the user attemps to close the dialog

      Parameters

      • button_index: number
      • Optionalevent: Event

      Returns boolean | void

    • Function to execute when the user confirms the dialog

      Parameters

      • formResult: any
      • event: Event

      Returns boolean | void

    • Function to run when anything in the form is changed

      Parameters

      • form_result: { [key: string]: FormResultValue }

      Returns void

    • Function to execute when the dialog is opened

      Returns void

    • Runs when the dialog is resized

      Returns void