Slider
Picks a value in a range by dragging, clicking the track or using the keyboard.
Installation
bash
shellui-native add slider
Platforms: MAUI · Avalonia.
Usage
Basic
40
<ui:Slider Value="40" Minimum="0" Maximum="100" ValueChanged="OnVolumeChanged" /><ui:Slider Value="40" Minimum="0" Maximum="100" Step="5" ValueChanged="OnVolumeChanged" />Not available on yet
MAUI and Avalonia
- MAUI tints the platform slider with the theme tokens; Avalonia draws a shadcn slider of its own.
Step(how far the arrow keys move it) is Avalonia only; Page Up / Down move 10 steps, Home and End jump to the ends.ValueChangedpasses the newdoubleon Avalonia.
API
| Property | Type | Default | Description |
|---|---|---|---|
Value |
double |
50 |
Current value, between Minimum and Maximum. Two-way bindable. |
Minimum |
double |
0 |
Smallest value. |
Maximum |
double |
100 |
Largest value. |
Step |
double |
1 |
Keyboard increment. Pointer input is continuous. Avalonia only. |
| Event | Arguments | Description |
|---|---|---|
ValueChanged |
ValueChangedEventArgs (MAUI) · double (Avalonia) |
User input only: setting Value from code or a binding doesn't raise it. |