Skip to main content

Switch

The Switchcomponent is the Komplete UI representation of a KSP ui_switch.

component Switch

Example

import { Switch } from kontakt_controls

export var main = Switch(control_id: "my_switch")

Switch Screenshot

Constructor

constructor(control_id: String, text: String? = nil, style: SwitchStyle = default_switch_style, disabled: Bool = false, policy: TriggerPolicy = TriggerPolicy.on_down)
control_id: String

This is the name that you assigned to the corresponding KSP ui_switch control.

text: String? = nil

The text to display if any.

style: SwitchStyle = default_switch_style

Customizes the appearance.

See SwitchStyle for more details.

disabled: Bool = false

Disables user interaction when set to [true]

policy: TriggerPolicy = TriggerPolicy.on_down

Configures whether to toggle on pointer down or up.

See TriggerPolicy