Skip to content

Slider

import { Slider, VerticalBox } from "std-widgets.slint";
export component Example inherits Window {
width: 200px;
height: 40px;
VerticalBox {
alignment: center;
Slider {
value: 42;
}
}
}
slint
slider example

Properties

enabled

bool default: true

You can’t interact with the slider if enabled is false.

has-focus

bool (out) default: false

Set to true when the slider currently has the focus

value

float (in-out) default: 0

The value. Defaults to the minimum.

Slider {
value: 50;
}
slint

step

float default: 1

The change step when pressing arrow key.

Slider {
step: 1;
}
slint

minimum

float default: 0

The minimum value.

Slider {
minimum: 10;
value: 11;
}
slint

maximum

float default: 100

The maximum value.

Slider {
maximum: 10;
value: 9;
}
slint

orientation

enum Orientation default: horizontal

Orientation

Represents the orientation of an element or widget such as the Slider.

  • horizontal: Element is oriented horizontally.
  • vertical: Element is oriented vertically.

If set to true the Slider is displayed vertical.

Callbacks

changed(float)

The value was changed

Slider {
changed(value) => {
debug("New value: ", value);
}
}
slint

released(float)

Invoked when the user completed changing the slider’s value, i.e. when the press on the knob was released or the arrow keys lifted.

Slider {
released(position) => {
debug("Released at position: ", position);
}
}
slint

© 2024 SixtyFPS GmbH