Options for creating a toggle control to layout customization and assigning a callback function

interface ToggleControlOptions {
    addClass?: string;
    addClassOff?: string;
    addClassOn?: string;
    getStatus?: (() => boolean);
    html?: HtmlDef | HtmlToggle;
    onClick?: OnToggleClick;
    status?: boolean;
    title?: string | TitleToggle;
}

Properties

addClass?: string

Additional css class string

addClassOff?: string

Additional css class string for off state only.

addClassOn?: string

Additional css class string for on state only.

getStatus?: (() => boolean)

Get current control status.

Button content, can be set for each state (on or off).

onClick?: OnToggleClick

Set an action to execute when button clicked.

status?: boolean

Boolean state of control.

title?: string | TitleToggle

Button HTMLElement title, can be set for each state (on or off).