Class MudSlider<T>
- Namespace
- MudBlazor
- Assembly
- MudBlazor.dll
Represents a slider component, allowing users to select a value within a specified range.
public class MudSlider<T> : MudComponentBase, IComponent, IHandleEvent, IHandleAfterRender, IMudStateHasChanged where T : struct, INumber<T>
Type Parameters
T
The type of the value the slider represents.
- Inheritance
-
MudSlider<T>
- Implements
- Inherited Members
- Extension Methods
Constructors
MudSlider()
public MudSlider()
Properties
ChildContent
Child content of component.
[Parameter]
[Category("Behavior")]
public RenderFragment? ChildContent { get; set; }
Property Value
Classname
protected string Classname { get; }
Property Value
Color
The color of the component. It supports the Primary, Secondary and Tertiary theme colors.
[Parameter]
[Category("Appearance")]
public Color Color { get; set; }
Property Value
Culture
Sets the culture information used for ValueLabel. Default is InvariantCulture.
[Parameter]
[Category("Appearance")]
public CultureInfo Culture { get; set; }
Property Value
Disabled
If true, the slider will be disabled.
[Parameter]
[Category("Behavior")]
public bool Disabled { get; set; }
Property Value
Immediate
If true, the dragging the slider will update the Value immediately. If false, the Value is updated only on releasing the handle.
[Parameter]
[Category("Behavior")]
public bool Immediate { get; set; }
Property Value
Max
The maximum allowed value of the slider. Should not be equal to min.
[Parameter]
[Category("Validation")]
public T Max { get; set; }
Property Value
- T
Min
The minimum allowed value of the slider. Should not be equal to max.
[Parameter]
[Category("Validation")]
public T Min { get; set; }
Property Value
- T
NullableValue
The nullable value of the slider.
[Parameter]
[Category("Data")]
public T? NullableValue { get; set; }
Property Value
- T?
NullableValueChanged
Event callback invoked when the nullable value of the slider changes.
[Parameter]
public EventCallback<T?> NullableValueChanged { get; set; }
Property Value
- EventCallback<T?>
Size
Labels for tick marks, will attempt to map the labels to each step in index order.
[Parameter]
[Category("Appearance")]
public Size Size { get; set; }
Property Value
Step
How many steps the slider should take on each move.
[Parameter]
[Category("Validation")]
public T Step { get; set; }
Property Value
- T
TickMarkLabels
Labels for tick marks, will attempt to map the labels to each step in index order.
[Parameter]
[Category("Appearance")]
public string[]? TickMarkLabels { get; set; }
Property Value
- string[]
TickMarks
If true, displays tick marks on the track.
[Parameter]
[Category("Appearance")]
public bool TickMarks { get; set; }
Property Value
Value
The value of the slider.
[Parameter]
[Category("Data")]
public T Value { get; set; }
Property Value
- T
ValueChanged
Event callback invoked when the value of the slider changes.
[Parameter]
public EventCallback<T> ValueChanged { get; set; }
Property Value
ValueLabel
Displays the value over the slider thumb.
[Parameter]
[Category("Appearance")]
public bool ValueLabel { get; set; }
Property Value
ValueLabelContent
Sets custom RenderFragment for ValueLabel.
[Parameter]
[Category("Appearance")]
public RenderFragment<SliderContext<T>>? ValueLabelContent { get; set; }
Property Value
Remarks
Keep in mind that for this RenderFragment to show the ValueLabel needs to be true
.
ValueLabelFormat
Sets the formatting information used for ValueLabel. Default is no formatting.
[Parameter]
[Category("Appearance")]
public string? ValueLabelFormat { get; set; }
Property Value
Variant
The variant to use.
[Parameter]
[Category("Appearance")]
public Variant Variant { get; set; }
Property Value
Vertical
If true, displays the slider vertical.
[Parameter]
[Category("Appearance")]
public bool Vertical { get; set; }
Property Value
Methods
BuildRenderTree(RenderTreeBuilder)
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
__builder
RenderTreeBuilder
OnParametersSet()
protected override void OnParametersSet()