StepsSlider
Description
A slider that snaps to discrete named steps
StepsSlider is a generic slider component that constrains movement to a fixed set of named values. Unlike a continuous slider, it only ever lands on one of the provided steps, making it suitable for cases where only a handful of distinct choices are valid.
Common uses include selecting T-shirt sizes, quality levels, priority tiers, or any domain-specific ordered category where a free numeric value would be meaningless.
API reference
public sealed class StepsSlider<T> : IComponent where T : IEquatable<T>A slider component that snaps to discrete steps.
Type Parameters
- T
- The type of the steps.
Constructors
Properties
public bool IsEnabled { get ; set ; }Gets or sets whether the slider is enabled.
Methods
public StepsSlider<T> Comparer(IEqualityComparer<T> equalityComparer)Sets the equality comparer for the steps.
Parameters
- equalityComparer
- The equality comparer.
Returns
The current instance.
public StepsSlider<T> SetValue(T val)Sets the value of the slider.
Parameters
- val
- The value.
Returns
The current instance.
public StepsSlider<T> OnChange(Action<T> onChange)Attaches a handler to the change event.
Parameters
- onChange
- The handler.
Returns
The current instance.
public StepsSlider<T> Disabled(bool value = true)Sets whether the slider is disabled.
Parameters
- value
- Whether it's disabled.
Returns
The current instance.