CheckBoxStyle
Defines the visual settings of a checkbox.
Fields
border_style(BorderStyle): Defines the style of the background border.box_style(BorderStyle): Defines the style of the check box.box_icon_style(IconStyle): Defines the style of the check box icon.text_style(TextStyle): Defines the style of the text.spacing(length): Defines the distance between elements in the checkbox layout. (default value: 0)layout_style(LayoutStyle): Defines the style of the layout.
CheckBoxBase
The CheckBoxBase represents the base for checkbox elements that can be styled by using CheckBoxStyle.
Properties
enabled(in bool): If set tofalsethe checkbox is disabled.checked(in-out bool): Whether the checkbox is checked or not (default: false).style(inCheckBoxStyle): Defines the style of the checkbox.
Callbacks
toggled(/* checked */ bool): Thecheckedvalue changed.
Example
import { CheckBoxBase } from "@vivi/foundation.slint";
export component MyCheckBox inherits CheckBoxBase {
width: 20px;
height: 20px;
style: {
background: black,
border_radius: 8px,
};
}
export component Example inherits Window {
width: 200px;
height: 100px;
MyCheckBox {
toggled(checked) => {
debug(checked);
}
}
}