Skip to content

Button

import { Button, VerticalBox } from "std-widgets.slint";
export component Example inherits Window {
width: 200px;
height: 100px;
VerticalBox {
label := Text {
text: "Button not clicked";
}
Button {
text: "Click Me";
clicked => {
label.text = " Button clicked";
}
}
}
}
slint

A simple button. Common types of buttons can also be created with StandardButton.

bool default: false

Shows whether the button can be checked or not. This enables the checked property to possibly become true.

Button {
text: "Checkable Button";
checkable: true;
}
slint

bool (in-out) default: false

Shows whether the button is checked or not. Needs checkable to be true to work.

bool default: true

Defaults to true. When false, the button cannot be pressed.

bool (out) default: false

Set to true when the button has keyboard focus

image default: the empty image

The image to show in the button. Note that not all styles support drawing icons.

length default: 0px

The size of the icon shown in the button. The default value depends on the style. The button will grow if needed to accommodate for large icon sizes.

bool (out) default: false

Set to true when the button is pressed.

string default: ""

The text written in the button.

Button {
text: "Button with text";
}
slint

bool default: false

If set to true the button is displayed with the primary accent color.

bool default: false

If set to true, the icon will be colorized to the same color as the Button’s text color.

Invoked when clicked: A finger or the left mouse button is pressed, then released on this element.

Button {
text: "Click me";
clicked() => {
debug("Button clicked");
}
}
slint

© 2025 SixtyFPS GmbH