Skip to content

@jsvision/ui / SwitchOptions

Interface: SwitchOptions ​

Defined in: ui/src/controls/switch.ts:38

Construction options for a Switch.

Properties ​

disabled? ​

optional disabled?: boolean

Defined in: ui/src/controls/switch.ts:50

Non-interactive and dim when true (also not focusable).


i18n? ​

readonly optional i18n?: I18n

Defined in: ui/src/controls/switch.ts:40

Explicit translation service for default state words.


label? ​

optional label?: string

Defined in: ui/src/controls/switch.ts:44

Optional caption drawn left of the track; ~X~ marks an Alt+hotkey.


offLabel? ​

optional offLabel?: string

Defined in: ui/src/controls/switch.ts:48

Text shown right of the track when off (default 'Off'); '' hides it.


onLabel? ​

optional onLabel?: string

Defined in: ui/src/controls/switch.ts:46

Text shown right of the track when on (default 'On'); '' hides it.


value ​

value: Signal<boolean>

Defined in: ui/src/controls/switch.ts:42

Two-way bound on/off state: reading renders the knob; an external write repaints.