Skip to content

Sliders ​

Material3.Avalonia themes the built-in Avalonia Slider and provides RangeSlider for selecting a lower/upper interval.

Slider ​

The standard Slider keeps Avalonia's complete value, keyboard, tick, orientation, and direction API while rendering the Material 3 Expressive 16dp track, 4x44 handle, handle gaps, and maximum stop indicator.

xml
<Slider Minimum="0" Maximum="100" Value="30" />
<Slider Minimum="0" Maximum="100"
        Value="70"
        TickFrequency="10"
        IsSnapToTickEnabled="True" />

RangeSlider ​

xml
<m3c:RangeSlider xmlns:m3c="using:Material3.Avalonia.Controls"
                 Minimum="-100"
                 Maximum="100"
                 LowerValue="-25"
                 UpperValue="40"
                 TickFrequency="5"
                 IsSnapToTickEnabled="True"
                 ValueIndicatorMode="Always"
                 ValueFormat="0" />

The selected interval uses Md3PrimaryBrush; the two outside tracks use Md3SecondaryContainerBrush. Both bounds have endpoint dots and each handle maintains the Material 3 six-dp track gap.

Properties ​

PropertyDefaultDescription
Minimum0Lowest permitted value.
Maximum100Highest permitted value.
LowerValue20Lower selected value. Two-way by default and clamped below UpperValue.
UpperValue80Upper selected value. Two-way by default and clamped above LowerValue.
SmallChange1Arrow-key step.
LargeChange10PageUp/PageDown step.
TickFrequency1Distance between snap points.
IsSnapToTickEnabledfalseSnaps both values to ticks measured from Minimum.
IsDirectionReversedfalseRenders minimum on the right and reverses directional keyboard/drag input.
ValueIndicatorModeOnInteractionNever, OnInteraction, or Always.
ValueFormat0.##.NET numeric format string for indicator text.

Events ​

  • LowerValueChanged
  • UpperValueChanged

Both use RangeSliderValueChangedEventArgs, which exposes OldValue and NewValue.

Keyboard ​

Tab focuses each handle independently. Arrow keys apply SmallChange; PageUp/PageDown apply LargeChange; Home/End move the focused handle to its allowed boundary.

Binding ​

xml
<m3c:RangeSlider LowerValue="{Binding MinimumPrice}"
                 UpperValue="{Binding MaximumPrice}" />

LowerValue and UpperValue use two-way binding by default.