Skip to content

ToggleComponent

Defined in: obsidian.d.ts:4160

Extends

Constructors

new ToggleComponent()

new ToggleComponent(containerEl): ToggleComponent

Defined in: obsidian.d.ts:4169

Parameters

containerEl

HTMLElement

Returns

ToggleComponent

Overrides

ValueComponent.constructor

Properties

changeCallback()?

optional changeCallback: (value) => void

Defined in: src/obsidian/augmentations/Components/ToggleComponent.d.ts:9

The function that’s called after changing the value of the component.

Parameters

value

boolean

Returns

void

disabled

disabled: boolean

Defined in: obsidian.d.ts:423

Inherited from

ValueComponent.disabled


toggleEl

toggleEl: HTMLElement

Defined in: obsidian.d.ts:4164

Methods

getValue()

getValue(): boolean

Defined in: obsidian.d.ts:4177

Returns

boolean

Overrides

ValueComponent.getValue


onChange()

onChange(callback): this

Defined in: obsidian.d.ts:4194

Parameters

callback

(value) => any

Returns

this


onClick()

onClick(): void

Defined in: obsidian.d.ts:4190

Returns

void


registerOptionListener()

registerOptionListener(listeners, key): this

Defined in: obsidian.d.ts:4219

Parameters

listeners

Record<string, (value?) => boolean>

key

string

Returns

this

Inherited from

ValueComponent.registerOptionListener


setDisabled()

setDisabled(disabled): this

Defined in: obsidian.d.ts:4173

Parameters

disabled

boolean

Returns

this

Overrides

ValueComponent.setDisabled


setTooltip()

setTooltip(tooltip, options?): this

Defined in: obsidian.d.ts:4186

Parameters

tooltip

string

options?

TooltipOptions

Returns

this


setValue()

setValue(on): this

Defined in: obsidian.d.ts:4181

Parameters

on

boolean

Returns

this

Overrides

ValueComponent.setValue


then()

then(cb): this

Defined in: obsidian.d.ts:428

Facilitates chaining

Parameters

cb

(component) => any

Returns

this

Inherited from

ValueComponent.then