Skip to content

SegmentedButton

import { SegmentedButton } from "material.slint";
export component Example inherits Window {
width: 300px;
height: 100px;
background: transparent;
SegmentedButton {
model: [
{ icon: @image-url("icons/list.svg"), text: "List" },
{ icon: @image-url("icons/grid.svg"), text: "Grid" }
];
current_item: 0;
}
}
slint

A SegmentedButton displays a group of related options as a single control, where only one option can be selected at a time.

int (in-out) default: 0

The index of the currently selected item.

[SegmentedItem] default: a SegmentedItem with default values

An array of segmented items, each containing an icon and text.

Selects the item at the specified index.

SegmentedButton {
clicked() => {
self.select(1);
}
}
slint

© 2025 SixtyFPS GmbH