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"; } } }}
A simple button. Common types of buttons can also be created with StandardButton.
Properties
Section titled “Properties”checkable
Section titled “checkable” 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;}
checked
Section titled “checked” bool (in-out)
default: false
Shows whether the button is checked or not. Needs checkable
to be true to work.
enabled
Section titled “enabled” bool default: true
Defaults to true. When false, the button cannot be pressed.
has-focus
Section titled “has-focus” 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.
pressed
Section titled “pressed” bool (out)
default: false
Set to true when the button is pressed.
primary
Section titled “primary” bool default: false
If set to true the button is displayed with the primary accent color.
colorize-icon
Section titled “colorize-icon” bool default: false
If set to true, the icon will be colorized to the same color as the Button’s text color.
Callbacks
Section titled “Callbacks”clicked()
Section titled “clicked()”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"); }}
© 2025 SixtyFPS GmbH