CheckBox

Use a CheckBox to let the user select or deselect values, for example in a list with multiple options. Consider using a Switch element instead if the action resembles more something that's turned on or off.

Properties

  • checked: (inout bool): Whether the checkbox is checked or not (default: false).
  • enabled: (in bool): Defaults to true. When false, the checkbox can't be pressed (default: true)
  • has_focus: (out bool): Set to true when the checkbox has keyboard focus (default: false).
  • text (in string): The text written next to the checkbox.

Callbacks

  • toggled(/* checked */ bool): The checkbox value changed

Example

import { CheckBox } from "@coop/lib.slint";

export component Example inherits Window {
    width: 200px;
    height: 25px;

    CheckBox {
        width: parent.width;
        height: parent.height;
        text: "Hello World";
    }
}