Skip to content

Slider

A retained native scalar slider.

Native Slider preview

A real Linux/X11 native capture in light appearance. The same control also supports the initial dark theme.

Runnable example

import gpyui as ui

control = ui.Slider(35, minimum=0, maximum=100, step=1)

app = ui.Application(ui.Column([control]), title="Slider", width=640, height=340)
app.run()

Run this in a fresh Python process on a desktop with the native build installed.

Properties

Property Default Type / accepted values Update
value 0 finite number Assignment
minimum 0 finite number Constructor only
maximum 100 finite number Constructor only
step 1 finite number Constructor only
disabled false bool Assignment

All controls support visible and dispose(). Hiding or detaching retains native state; disposal permanently releases it. See Control.

Events and state

  • on_change(event): Runs after native value and Python mirror/bound State change.
  • on_release(event): Reports the slider value when the native drag is released.

Handlers can take zero arguments or one Event, and can be synchronous or async. They run on the owned Python asyncio loop. See events and asyncio.

bind_value(State(...)) binds both ways without echoing native edits back through setters. unbind() disposes the subscription. See state binding.

Contract and limits

minimum < maximum, step > 0, and value must remain in range. Range and step are fixed. on_release reports the released value.

All controls accept pixel layout and semantic theme styling through .style(...). Collections are copied on assignment/read: reassign them to submit updates.

Python implementation · Native builders · Full coverage and remaining Kit APIs