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.

booldefault: 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.

booldefault: true

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

bool(out)

Set to true when the button has keyboard focus

imagedefault: the empty image

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

lengthdefault: 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)

Set to true when the button is pressed.

stringdefault: ""

The text written in the button.

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

booldefault: false

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

booldefault: 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

© 2026 SixtyFPS GmbH