Skip to content

CheckboxCommand

A checkbox command shown in a SuggestModal’s instruction bar and bound to a modifier+key shortcut that toggles it.

Import:

import type { CheckboxCommand } from 'obsidian-dev-utils/obsidian/modals/suggest-modal-command-builder';

Signature:

export interface CheckboxCommand

Properties

PropertyTypeDescription
keystringThe key that toggles the checkbox.
modifiers?Modifier[]The modifiers combined with CheckboxCommand.key to toggle the checkbox. When omitted, no modifiers are required.
purposestringThe human-readable description shown next to the checkbox in the instruction bar.

Methods

MethodReturnsDescription
onChange(value)voidCalled when the checkbox value changes.
onInit(checkboxEl)voidCalled once with the created checkbox element, to initialize its state.