Slider
A Fluent slider, for choosing a value from a range.
Example:
fluent.Slider(value=40, on_change=lambda e: print(e.data))

Inherits: LayoutControl
Properties
autofocus- Whether this slider should be focused on initial display.divisions- The number of discrete steps betweenminandmax.label- The text shown in a tooltip above the thumb while it is dragged.max- The maximum value.min- The minimum value.value- The current value.vertical- Whether the slider is vertical instead of horizontal.
Events
on_change- Called while the value changes.on_change_end- Called when the user stops changing the value.on_change_start- Called when the user starts changing the value.
Example
Fluent Slider
import flet_fluent_ui as fluent
import flet as ft
def main(page: ft.Page):
page.title = "Fluent Slider"
def handle_change(e: ft.Event[fluent.Slider]):
status.value = f"Volume: {round(e.control.value)}"
status = ft.Text("Volume: 40")
page.add(
ft.SafeArea(
content=ft.Column(
width=300,
controls=[
fluent.Slider(
key="volume",
value=40,
label="Volume",
on_change=handle_change,
),
fluent.Slider(value=3, max=5, divisions=5),
status,
],
)
)
)
if __name__ == "__main__":
ft.run(main)

Properties
autofocusclass-attributeinstance-attribute
autofocus: bool = FalseWhether this slider should be focused on initial display.
divisionsclass-attributeinstance-attribute
divisions: int | None = NoneThe number of discrete steps between min and max.
If None, the slider is continuous.
labelclass-attributeinstance-attribute
label: str | None = NoneThe text shown in a tooltip above the thumb while it is dragged.
If None, no tooltip is shown.
verticalclass-attributeinstance-attribute
vertical: bool = FalseWhether the slider is vertical instead of horizontal.
Events
on_changeclass-attributeinstance-attribute
on_change: ControlEventHandler[Slider] | None = NoneCalled while the value changes.
The data property of the event handler argument
contains the new value.
on_change_endclass-attributeinstance-attribute
on_change_end: ControlEventHandler[Slider] | None = NoneCalled when the user stops changing the value.
The data property of the event handler argument
contains the final value.
on_change_startclass-attributeinstance-attribute
on_change_start: ControlEventHandler[Slider] | None = (
None
)Called when the user starts changing the value.