Skip to main content

ToggleButton

The ToggleButtoncomponent is the Komplete UI representation of a KSP ui_button.

component ToggleButton

Example

import { ToggleButton } from kontakt_controls

export var main = ToggleButton(control_id: "my_button")

ToggleButton Screenshot

Constructor

constructor(control_id: String, text: String? = nil, style: ToggleButtonStyle = default_toggle_button_style, disabled: Bool = false, policy: TriggerPolicy = TriggerPolicy.on_up)
control_id: String

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

text: String? = nil

The text to display if any.

style: ToggleButtonStyle = default_toggle_button_style

Customizes the appearance.

See ToggleButtonStyle for more details.

disabled: Bool = false

Disables user interaction when set to [true]

policy: TriggerPolicy = TriggerPolicy.on_up

Configures whether to toggle on pointer down or up.

See TriggerPolicy