Skip to content

Inputs

Slider

Bit.BlazorUIRange

BitSlider turns a number into a distance you can point at: drag the thumb, press the rail to send it there, or step it with the keyboard. A second thumb turns it into a range, with distances to keep the two apart, an option to stop them crossing or to let one push the other, and a band to slide the whole range by. The fill can grow from either end or from an origin of your own, or be dropped altogether; marks can be drawn, labelled, and made the only values the user may land on; and a floating label can ride along with the thumb. It runs horizontally or vertically, in three sizes and any theme color, and - because it is built on native range inputs - touch dragging, form posting, EditForm validation and the whole slider keyboard come with it.

Usage

Every example is live. Open its code to see exactly what produced the component running underneath.

Basic

Min, Max and Step set the scale and the distance between two values the user can land on - 0 to 10 stepping by 1 unless you say otherwise. Left unbound the slider keeps its own state, and DefaultValue only picks where that state starts. Disabled greys it out and takes it out of the tab order; ReadOnly keeps it at full contrast, focusable and announced, and refuses every change.
The thumb answers the pointer three ways: drag it, press the rail anywhere to send it there and carry straight on dragging, or step it with the keyboard. A value that arrives in one jump is eased into; a thumb held under the pointer follows it exactly and takes the accent's pressed shade while it does.

Basic:

DefaultValue:

Min, Max and Step (a snapping slider):

Disabled:

ReadOnly:

Range

IsRanged gives the slider a second thumb, so it selects a span rather than a point - a price bracket, an age band, the hours a shift covers. The ends are LowerValue and UpperValue, each bindable on its own, with RangeValue carrying both at once and DefaultLowerValue / DefaultUpperValue as their unbound counterparts.
The rail is divided between the two thumbs at their midpoint: press it anywhere and the nearer thumb comes to meet you, then keeps following the pointer as if you had grabbed it. The keyboard reaches them as two tab stops in a fixed order. By default the thumbs may cross - Range constraints shows how to stop them.

Basic:

DefaultLowerValue and DefaultUpperValue:

RangeValue, bound to both ends at once:

Disabled:

Marks

ShowMarks draws a tick at every Step. MarkStep widens that interval for a scale too fine to mark at each one - a 0 to 1000 slider wants its marks every 100 - and ShowMarkLabels writes each tick's value underneath, formatted the way the value labels are. ShowMarkLabels asks for the marks on its own, so ShowMarks is only needed when nothing else has - while MarkStep only spaces the marks something else has asked for.
For anything beyond a regular series, hand Marks a list of BitSliderMark - a value, an optional label, its own class and style. That is how a scale gets named stops ("Low", "Medium", "High") instead of numbers, or one threshold gets painted red; a mark left without a label takes its own value while ShowMarkLabels is on. Marks the fill has reached are repainted so they stay legible on top of it, and marks outside Min..Max are skipped.
MarkLabelTemplate replaces the text under every mark with markup of your own, handed the mark it belongs to - a row of faces, an icon per tier, a value over a caption. It asks for the marks like the other two. They are decoration and hidden from screen readers either way, so a scale labelled only by pictures still needs AriaValueText to say what it is on.
RestrictToMarks makes the marks the only values the user can pick, which is what turns an irregular scale into something the pointer and the keyboard can both land on exactly. A drag lands on the mark nearest the pointer; an arrow key always reaches the next one along, however short a Step is against the gap between them. On a range a snapped move still stops at the outermost mark the constraints leave room for. It governs only what the user can pick - a value bound from elsewhere is always drawn where it actually is.

ShowMarks:

ShowMarkLabels, which asks for the marks as well:

MarkStep, for a scale too fine to mark at every step:

Named stops through Marks:

Marks of your own: the unlabelled ones take their value, and one carries a style of its own:

MarkLabelTemplate, a scale whose stops are faces:

RestrictToMarks, on an irregular scale (drag it, or use the arrow keys):

On a range, restricted to the marks and keeping its ends four apart:

Vertical

IsVertical stands the slider upright and fills it from the bottom up, so "more" is up - the direction ArrowUp already means. The marks, their labels and the floating thumb label follow, and the value labels stack instead of flanking. An upright slider has no length of its own to inherit, so it takes one from the --bit-Slider-length CSS variable, per instance or globally. Reach for it when the value is naturally a height - a level, a gain, a temperature.

Fill, origin & inversion

The fill normally grows out of the near end, which reads as "how much". IsOriginFromZero anchors it to zero instead, so a negative value fills one way and a positive one the other, with a tick where zero actually sits - only the middle of the track on a scale symmetric around it, as the -2..8 example shows. Origin is the same idea with any anchor: a target, a baseline, last month's figure. Both are held inside Min..Max, and both are about the single value - a range already has two ends of its own to fill between.
Inverted moves the origin to the far end, so the fill shows what is left rather than what is used; an inverted range fills the two outer segments instead, which is how an excluded band is drawn. NoFill removes the bar altogether for a value with no sense of accumulation - a hue, a seek point - and with it the repainting of the marks the fill would have reached.

IsOriginFromZero on a symmetric scale:

IsOriginFromZero on an asymmetric one (zero is not the middle):

Origin, anchored to a target rather than to zero:

Inverted, showing what is left rather than what is used:

An inverted range, drawing the excluded band:

NoFill, a position rather than a quantity:

NoFill on a range:

Thumb label

ThumbLabel puts the value on the thumb. Auto shows it only while the slider is hovered, dragged or focused; On keeps it there permanently. It follows both ends of a range and takes the same ValueFormat the other labels do. A horizontal slider holds the room the label rises into open above its track - --bit-Slider-thumb-label-room - so an Auto label appearing mid-drag never lands on the caption; an upright one puts the label beside the thumb, on the side the mark labels do not take. Pair it with ShowValue="false" to keep the row compact.
ThumbLabelTemplate replaces its content with markup of your own - an icon that changes with the level, a unit in its own type. It is handed the value that thumb stands for, so one template serves both ends of a range.

Auto - hover, drag or focus it:

On:

On a range:

Vertical:

ThumbLabelTemplate, an icon that follows the level:

Range constraints

MinRange is the smallest distance the two thumbs may be apart, which keeps a range from collapsing onto a single value; MaxRange is the largest, so a thumb stretching the range past it stops there; NoSwap asks for the ordering alone. Any of the three also stops the thumbs crossing. A starting pair that does not satisfy them is widened or narrowed until it does and reported back to whatever the range is bound to, and limits that contradict each other resolve rather than lock up.
Pushable changes what happens when the thumbs meet: the moving one carries the other along instead of stopping against it, so a constrained range slides bodily across the scale from either end rather than a thumb at a time. The pushed thumb stops at the end of the scale and the pushing one rests beside it. It has nothing to do until there is a MinRange to keep or a NoSwap to hold.
All of them are enforced by the browser rather than corrected afterwards - the constraint is pushed into the bounds of the underlying input - so a thumb never moves somewhere it will be pulled back from, by pointer or by key, and that holds for a move snapped onto a mark too.

Unconstrained (drag the thumbs past each other):

NoSwap:

MinRange of 20:

MaxRange of 30:

MinRange of 10 and MaxRange of 40 together:

Pushable, on a range 20 wide (drag either thumb into the other):

Pushable with NoSwap alone, so the thumbs may meet before they push:

Draggable band

DraggableTrack makes the filled band a handle in its own right: press it and the whole range travels with the pointer, keeping the width it had - one gesture instead of dragging one end and then chasing it with the other. It comes to rest when its leading end reaches the end of the scale, or the outermost mark that still leaves room for its width, and since the thumbs never change their distance on the way, every range constraint holds throughout.
Only the rail strictly between the thumbs takes the drag, so the thumbs stay grabbable and a band squeezed below a thumb's width has nothing to take hold of - which is what keeps a range dragged shut from being impossible to open again. The trade is that a press on the band no longer sends the nearer thumb there.
It reports through OnRangeChange and OnRangeChangeEnd like any other move; set MinRange and MaxRange to the same number for a fixed-width window. It is a pointer gesture, so the keyboard still reaches the two ends one thumb at a time.

Drag the band, not just the thumbs:

A fixed-width window, MinRange and MaxRange both 20:

With marks, where the band lands on them:

Vertical:

Value display

ValueFormat is an ordinary .NET numeric format string, applied to every label the slider draws - beside the track, under the marks and on the thumb - and rendered in the culture of the user. When the number is not what the value means, GetValueText builds each label from the value itself: minutes as "12:30", bytes as "1.5 MB", a step index as the word it stands for. ShowValue="false" drops the labels beside the track, and LabelTemplate replaces the plain Label with markup of your own.
The labels are set in tabular figures and hold open the width of the longest text the scale reads, so the track keeps its length as the value crosses from 9 to 10 instead of resizing under the thumb.

ValueFormat:

GetValueText, on a slider whose numbers are minutes past midnight:

ShowValue="false":

LabelTemplate:

Binding

@bind-Value is the usual two-way binding. Handing Value over one-way instead makes the slider follow that value and refuse to change it on its own, for when something else owns the number - the first pair below is driven entirely by the rating beside it. A range has three bindings: @bind-LowerValue and @bind-UpperValue separately, or @bind-RangeValue for both at once. All three are kept in step, so a slider bound only by RangeValue still reports through LowerValueChanged.

One-way (the rating owns the value):

Two-way:

Two-way on both ends of a range:

Events

OnChange fires on every step, which is what keeps a live preview in sync with the thumb. OnChangeEnd fires once, when the interaction ends, and that is where anything expensive belongs: a query, a save, a request. A range has the same pair as OnRangeChange and OnRangeChangeEnd, each handed a BitSliderRangeValue carrying both ends. Drag the sliders below and watch how much more often the first counter moves than the second.
OnFocusIn and OnFocusOut fire as a thumb takes and gives up the focus. A range reports through both from either thumb, so tabbing from one to the other fires an out and then an in.

OnChange and OnChangeEnd:

OnRangeChange and OnRangeChangeEnd:

OnFocusIn and OnFocusOut (tab into the slider, then out of it):

Validation

Inside an EditForm the slider is a form field like any other: it joins the EditContext, reports every move to it, and repaints its track and thumb in the error color while the value is invalid. Since a slider always holds some number, the interesting annotation is usually a Range narrower than the scale itself allows. Required announces that expectation ahead of the failure instead of leaving the error message to be the first mention of it, and Name makes the value readable by a plain form post.
A range joins through @bind-RangeValue: the pair is one field of the model rather than two, so it carries its own annotation and repaints the moment the pair stops satisfying it. The second form below asks for a span of at least 20 - drag the thumbs together and the error comes back without waiting for another submit.



Accessibility

Every thumb is a real range input, so the whole slider keyboard is there without asking: the arrows move by a Step, PageUp / PageDown jump further, and Home / End go to the ends of the scale. A range is two tab stops in a fixed order, as the WAI-ARIA multi-thumb pattern prescribes, and each thumb announces the bounds it can actually reach - so a constrained range tells a screen reader user where the thumb beside it has stopped them. A read-only slider is the exception: its bounds refuse the change rather than describe the value, so it announces the whole scale.
LargeStep names how far those larger jumps go. Left alone they are whatever the browser makes of a Page key - every engine measures it differently and none makes anything of Shift - which is hopeless on a long scale. Setting it pins the Page keys to that distance and gives Shift with an arrow the same reach, leaving the rest of the keyboard as it was. A jump is held inside the same bounds every other move is, and lands on a mark while RestrictToMarks is on.
Label names the slider when nothing else does, AriaLabel overrides it, and LowerAriaLabel / UpperAriaLabel name the two ends of a range apart - without them a screen reader announces the same name twice and the user cannot tell which thumb they are on. Where the thumbs may cross, the names travel with the values, so the one announced as the minimum always holds it. A slider captioned only by a LabelTemplate points both thumbs at that caption instead. AriaValueText is what a thumb announces in place of its number - 2 as "Medium", 750 as "12:30" - and falls back to GetValueText when only the visible form is given. AutoFocus, FocusAsync and FocusUpperAsync place the focus, and the two inputs are there as SliderInputElement and UpperSliderInputElement.
AriaDescription carries what a name has no room for - a unit, a rule - into a hidden element every thumb points at through aria-describedby, so it is announced after the name and the value; an id you pointed the inputs at yourself, a validation message among them, is kept alongside it rather than replaced. A range is wrapped in a labelled group, as the multi-thumb pattern asks. Required is announced through aria-required and marked with the usual asterisk. The labels the slider draws - the value beside the track, the text under a mark - are left out of the accessibility tree, since the thumb beside them announces the same value and a reader given both would say every number twice. Each thumb's grab area is at least 24px across whatever size it is drawn at, meeting the minimum pointer target of WCAG 2.2, and a drag answers with the accent's pressed shade the way a keyboard focus answers with a ring.

AriaValueText, naming the steps of a scale (listen, or inspect aria-valuetext):

LargeStep of 100 (focus a thumb, then use Page Up / Page Down or Shift with an arrow key):

LargeStep on a range, where each thumb stops against the other:

Named ends on a range (inspect the aria-label of each thumb):

FocusAsync and FocusUpperAsync, reaching either thumb from code:

AriaDescription and Required (inspect aria-describedby, or listen):
In thousands of euros. The plan has to cover at least twenty.

A range in a labelled group (inspect the role and the aria-labelledby of the root):
Both ends are days from today.

A range captioned only by a LabelTemplate (inspect the aria-labelledby of each thumb):

Cascading parameters

BitParams carries a BitSliderParams down to every slider under it, so a panel, a form or a page sets the shared scale, marks and look once instead of on every slider. What it carries is a default and not an override: a slider that writes a parameter for itself keeps its own value and takes from the cascade only what it left unset.
Everything a group can share is on the params object - the scale and the step, the marks, the color and the size, the accessible names of the two ends of a range - together with the ReadOnly and Required every input inherits, which is what makes a whole section of a form read-only in one place. What each slider holds of its own is not: a value, a default value, a name, the templates and the event callbacks stay on the markup.

Takes the scale, the step, the marks, the color and the size from the cascade:

So does this one, without repeating any of it:

Its own Color and ShowMarkLabels, the cascaded rest:

Outside the cascade, and back to the defaults:

Color

Color picks the theme color the fill and the thumbs are painted in, with Primary as the default; the rail stays neutral whichever is chosen, so it keeps reading as "not reached yet" rather than as a second, dimmer accent. The semantic colors tie the slider to what its value means, while the Background, Foreground and Border families keep it legible on non-default surfaces like the inverted panel below. Each brings its own hover, pressed and focus shades with it.



Size

Size scales the track, the thumbs and the labels together, from the Small that fits a dense settings panel to the Large that carries the main control on a page; Medium is the default. Whichever it is, the grab area stays at least 24px across, so even a Small slider is usable with a finger.

Small:

Medium:

Large:

Vertical, in all three:

Style & Class

Style and Class reach the root element. Styles and Classes go a level deeper and address the parts by name - Root, Label, Container, SliderBox, Track, Fill, Thumb (with LowerThumb and UpperThumb for the two ends of a range), the underlying inputs (ValueInput, LowerValueInput, UpperValueInput and the TrackInput a draggable band adds), Mark, MarkLabel, ThumbLabel, OriginFromZero and the value labels - so the fill can take a gradient, the thumbs a shape of their own, or the two ends of a range two different colors.

Component's Style & Class:



Styles & Classes:


The two thumbs of a range, styled apart:


For what no parameter and no part covers, the slider reads a set of CSS variables off its root: the geometry of the thumb and the rail, every color of every state, the type of the labels, the room the mark labels and the floating one are given, and the look of that floating label. They inherit, so a value on :root or any ancestor re-skins every slider below it while one on Style re-skins that instance alone, and anything left unset falls back to the theme token beside it - which is how a reshaped slider still follows the Material or Cupertino preset.

The geometry - the thumb, the rail and their corners:

The colors, the marks and the floating label:

Set once on an ancestor, inherited by every slider inside it:

RTL

Setting Dir to Rtl mirrors the whole slider: the scale starts on the right, the fill grows leftwards from it, the marks and their labels follow that edge, and ArrowLeft raises the value because that is the direction the scale now runs in. A vertical slider is deliberately left alone, since up means more in both directions of reading.



CSS variables

The public custom properties this component reads off its root, for what no parameter covers.

Every variable is read with a fallback and never declared by the component, so it inherits like any other custom property: set one on :root (or in a [bit-theme] block) to restyle every instance, on any ancestor to restyle the ones inside it, or on the Style of one instance to restyle that one alone. Leave a variable unset and the component falls back to the theme token beside it.

BitSlider CSS variables

Name Default value Description
--bit-Slider-color The Color role's main color The accent: the filled part of the track and the ring around every thumb.
--bit-Slider-hover-color --bit-Slider-color when set, otherwise the Color role's hover color The accent while the slider is hovered (pointer devices only).
--bit-Slider-active-color --bit-Slider-color when set, otherwise the Color role's active color The accent while a thumb - or the draggable band - is held down, which is the feedback a pointer drag gets in place of the focus ring a keyboard gets.
--bit-Slider-focus-color --bit-Slider-color when set, otherwise the Color role's focus color The ring around the thumb that holds the keyboard focus. A slider whose value is invalid ignores it and takes --bit-Slider-invalid-color (the error focus color by default) instead.
--bit-Slider-disabled-color --bit-clr-bg-dis The fill, the thumb ring, the marks and the origin tick while Disabled is true.
--bit-Slider-invalid-color --bit-clr-err The fill, the thumb ring and the focus ring while the value is invalid. The focus ring falls back to the error focus color rather than to --bit-clr-err.
--bit-Slider-rail-color --bit-clr-bg-sec The part of the track the fill has not reached, which stays neutral whichever Color is picked.
--bit-Slider-rail-size --bit-siz-track-sm / -md / -lg, per Size Thickness of the rail and of the fill.
--bit-Slider-rail-radius The rail thickness Corner radius of the rail and of the fill. The default rounds them into a pill; set it to 0 for a square-ended bar.
--bit-Slider-thumb-size --bit-siz-slider-thumb-sm / -md / -lg, per Size Diameter of a thumb. It is also the width a vertical slider lays its track inside, and the room kept clear at each end of the track for the thumb to travel into.
--bit-Slider-thumb-radius --bit-shp-radius-full Corner radius of a thumb.
--bit-Slider-thumb-border-width --bit-shp-brd-width-thick Thickness of the accent ring around a thumb.
--bit-Slider-thumb-background --bit-clr-bg-pri The face of a thumb, inside its ring. A page background is what keeps a thumb a distinguishable shape where it overlaps the fill.
--bit-Slider-thumb-shadow none Elevation of a thumb. It is also what a thumb falls back to when it gives the focus ring up, since the ring and the shadow are the same property.
--bit-Slider-length 9rem / 12rem / 15rem, per Size Length of a vertical slider, which has none of its own to inherit from the line it sits on. It has no effect on a horizontal one, which fills its container.
--bit-Slider-gap 0.5rem Room between the track and the value labels beside it.
--bit-Slider-font-size Per Size, from the type ramp Size of the caption and of the value labels.
--bit-Slider-font-weight --bit-tpg-field-label-font-weight (caption), --bit-tpg-fw-semibold (value labels) Weight of the caption and of the value labels.
--bit-Slider-letter-spacing --bit-tpg-ctrl-letter-spacing Tracking of the caption and of the value labels.
--bit-Slider-label-color --bit-clr-fg-pri Color of the caption above the slider.
--bit-Slider-value-color --bit-clr-fg-pri Color of the value labels beside the track.
--bit-Slider-required-color --bit-clr-req The asterisk drawn after the caption of a required slider.
--bit-Slider-mark-size The rail thickness, floored at 2px Diameter of a mark tick. The floor is what keeps the marks of a hairline rail visible.
--bit-Slider-mark-color --bit-clr-fg-ter A mark the fill has not reached.
--bit-Slider-mark-active-color The Color role's on-color A mark the fill has reached, drawn on top of it in the contrasting color so it stays legible there.
--bit-Slider-mark-label-color --bit-clr-fg-sec The text written under a mark.
--bit-Slider-mark-label-font-size Per Size, one ramp step below the value labels Size of that text.
--bit-Slider-mark-label-height 1.5em of that text Height of the row the mark labels stand in under a horizontal track. The labels are taken out of the flow, so the row is what reserves the space under the track for them - a MarkLabelTemplate taller than a line of text has to be given the room here. An upright slider measures its own row against the length of the track.
--bit-Slider-thumb-label-color The Color role's on-color Text of the floating label that rides along with a thumb.
--bit-Slider-thumb-label-background The accent color Background of that label.
--bit-Slider-thumb-label-radius --bit-shp-radius-popup Its corner radius.
--bit-Slider-thumb-label-padding 0.125rem 0.375rem Its padding.
--bit-Slider-thumb-label-font-size As the mark labels Its font size.
--bit-Slider-thumb-label-room 2.75x the label's font size The room held open above a horizontal slider for the floating label to rise into, so it never lands on the caption or on whatever else the page has put above the slider. Set it to 0 to take the room back and let the label overlap. An upright slider needs none: its label stands beside the track.
--bit-Slider-origin-color --bit-clr-fg-sec The tick marking where the fill grows out of, drawn by Origin and IsOriginFromZero.
--bit-Slider-origin-width --bit-shp-brd-width-thick Thickness of that tick.
--bit-Slider-transition-duration --bit-mot-duration-short How long the fill and the thumbs take to follow a value that arrives in one jump - a key, a press on the rail, a change made elsewhere on the page. A thumb held under the pointer is never eased, whatever this is set to.

API

Every parameter, public member, sub-class and enum this component exposes.

BitSlider parameters

Name Type Default value Description
AriaDescription string? null A description of the Slider for the benefit of screen readers, beyond the name its label already gives it. It is rendered into a visually hidden element that every thumb references through its aria-describedby attribute, so it is announced after the name and the value rather than becoming part of the name.
AriaValueText Func<double, string>? null A text description of the Slider number value for the benefit of screen readers. This should be used when the Slider number value is not accurately represented by a number. The returned text becomes the aria-valuetext of every thumb.
AutoFocus bool false If true, the slider automatically receives focus when the page renders.
Classes BitSliderClassStyles? null Custom CSS classes for different parts of the BitSlider.
Color BitColor? null The general color of the slider, applied to the filled part of the track and to the thumbs.
DefaultLowerValue double? null The default lower value of the ranged Slider, used when LowerValue is not bound.
DefaultUpperValue double? null The default upper value of the ranged Slider, used when UpperValue is not bound.
DefaultValue double 0 The default value of the Slider, used when Value is not bound.
DraggableTrack bool false Lets the filled band between the two thumbs of a ranged Slider be dragged bodily, so the whole range travels at once and keeps the width it had. Only the rail strictly between the thumbs takes the drag, so the thumbs themselves stay grabbable.
GetValueText Func<double, string>? null Builds the text of every label the Slider draws from the value it stands for. Takes precedence over ValueFormat, and is what AriaValueText falls back to.
Inverted bool false Fills the track from the far end instead of from the near one. A ranged slider inverts into the two outer segments, leaving the span between the thumbs unfilled.
IsOriginFromZero bool false Attaches the origin of the filled part of the track to zero. Shorthand for setting Origin to 0.
IsRanged bool false If ranged is true, display two thumbs that allow the lower and upper bounds of a range to be selected.
IsVertical bool false Whether to render the slider vertically. Its length comes from the --bit-Slider-length CSS variable, which defaults to 12rem.
Label string? null Description label of the Slider, which also names it for assistive technologies when no AriaLabel is given.
LabelTemplate RenderFragment? null Replaces the plain text Label of the Slider with custom content.
LargeStep double? null The distance the larger keyboard jumps cover: Page Up and Page Down, and an arrow key held with Shift. It defaults to whatever the browser does on its own.
LowerAriaLabel string? null The accessible name of the lower thumb of a ranged slider.
LowerValue double 0 The lower value of the ranged Slider.
Marks IEnumerable<BitSliderMark>? null The marks drawn along the track of the Slider, each optionally carrying a label. Takes precedence over ShowMarks.
MarkLabelTemplate RenderFragment<BitSliderMark>? null Replaces the text under every mark with content of your own, built from the mark it belongs to. Setting it also asks for the marks.
MarkStep double? null The interval between the generated marks, which setting is enough to ask for them. Defaults to the Step.
MaxRange double? null The largest distance the two thumbs of a ranged slider are allowed to be apart.
MinRange double 0 The smallest distance the two thumbs of a ranged slider are allowed to be apart. Any value above zero also stops the thumbs from crossing.
Min double 0 The min value of the Slider.
Max double 10 The max value of the Slider.
Name string? null The name of the underlying range input, which is what makes the value readable by a plain form post.
NoFill bool false Leaves the track unfilled, so the slider is a bare rail with a thumb on it rather than a bar that grows. It also turns off the highlighting of the marks the fill would otherwise have reached.
NoSwap bool false Stops the two thumbs of a ranged slider from crossing over each other.
OnChange EventCallback<double> Callback when the value of a single-value Slider changes. This is called on every individual step.
OnChangeEnd EventCallback<double> Callback for when the interaction that changes the value ends, rather than on every step along the way.
OnFocusIn EventCallback<FocusEventArgs> Callback for when a thumb of the Slider receives the focus.
OnFocusOut EventCallback<FocusEventArgs> Callback for when a thumb of the Slider loses the focus.
OnRangeChange EventCallback<BitSliderRangeValue> Callback when the range of a ranged Slider changes. This is called on every individual step.
OnRangeChangeEnd EventCallback<BitSliderRangeValue> Callback for when the interaction that changes the range ends, rather than on every step along the way.
Origin double? null The value the filled part of the track grows out of, instead of the near end of the track. Has no effect on a ranged slider.
Pushable bool false Lets a thumb of a ranged slider push the other one along instead of stopping against it. It has nothing to do without a MinRange to keep or a NoSwap ordering to hold, and it keeps the thumbs on their own sides since pushing and crossing are opposites.
RangeValue BitSliderRangeValue? null The range value of the Slider. Use this parameter to get or set both the LowerValue and the UpperValue at once.
ReadOnly bool false Makes the Slider read-only: still focusable and announced, but refusing every change.
Required bool false Marks the Slider as required, which is announced through aria-required.
RestrictToMarks bool false Restricts the values the user can pick to the marks alone, so the thumb jumps from one mark to the next instead of moving by the Step in between them.
ShowMarks bool false Draws a mark at every MarkStep (or every Step when that is not set) along the track. Setting MarkStep or ShowMarkLabels asks for the same series without it.
ShowMarkLabels bool false Writes each mark's own value underneath it, which also asks for the marks. A mark handed to Marks with a label of its own keeps that label.
ShowValue bool true Whether to show the value beside the Slider.
Size BitSize? null Size of the Slider, which scales its track, thumbs and labels together.
SliderBoxHtmlAttributes Dictionary<string, object>? null Additional html attributes for the Slider box, the element the track and the inputs are laid inside of.
Step double 1 The difference between the two adjacent values of the Slider. Values of zero or below fall back to 1.
Styles BitSliderClassStyles? null Custom CSS styles for different parts of the BitSlider.
ThumbLabel BitSliderThumbLabel? null Decides when the floating label that rides along with the thumb is shown.
ThumbLabelTemplate RenderFragment<double>? null Replaces the text of the floating label that rides along with the thumb with custom content, built from the value that thumb stands for.
UpperAriaLabel string? null The accessible name of the upper thumb of a ranged slider.
UpperValue double 0 The upper value of the ranged Slider.
Value double 0 The value of the Slider.
ValueFormat string? null Custom format for the displayed value of the Slider, applied to the value labels, the mark labels and the floating thumb labels alike.

BitComponentBase parameters

Name Type Default value Description
AriaLabel string? null Gets or sets the accessible label for the component, used by assistive technologies.
Class string? null Gets or sets the CSS class name(s) to apply to the rendered element.
Dir BitDir? null Gets or sets the text directionality for the component's content.
Disabled bool false Gets or sets a value indicating whether the component is disabled and cannot respond to user interaction.
ForceAnimation bool false Gets or sets a value indicating whether the component's animations play at their full duration even when reduced motion is requested.
HtmlAttributes Dictionary<string, object> new Dictionary<string, object>() Captures additional HTML attributes to be applied to the rendered element, in addition to the component's parameters.
Id string? null Gets or sets the unique identifier for the component's root element.
Style string? null Gets or sets the CSS style string to apply to the rendered element.
TabIndex string? null Gets or sets the tab order index for the component when navigating with the keyboard.
Visibility BitVisibility BitVisibility.Visible Gets or sets the visibility state (visible, hidden, or collapsed) of the component.

BitComponentBase public members

Name Type Default value Description
UniqueId Guid Guid.NewGuid() Gets the readonly unique identifier for the component's root element, assigned when the component instance is constructed.
RootElement ElementReference Gets the reference to the root HTML element associated with this component.

BitSliderClassStyles properties

Name Type Default value Description
Root string? null Custom CSS classes/styles for the BitSlider's root element.
Label string? null Custom CSS classes/styles for the BitSlider's label.
Container string? null Custom CSS classes/styles for the BitSlider's container.
SliderBox string? null Custom CSS classes/styles for the BitSlider's box, the element the track and the inputs are laid inside of.
Track string? null Custom CSS classes/styles for the BitSlider's track, the full-length rail the thumb travels along.
Fill string? null Custom CSS classes/styles for the BitSlider's fill, the highlighted part of the track.
Thumb string? null Custom CSS classes/styles for the BitSlider's thumbs, the handles that travel along the track.
LowerThumb string? null Custom CSS classes/styles for the lower thumb of a ranged BitSlider, added on top of Thumb.
UpperThumb string? null Custom CSS classes/styles for the upper thumb of a ranged BitSlider, added on top of Thumb.
LowerValueInput string? null Custom CSS classes/styles for the BitSlider's lower value input.
UpperValueInput string? null Custom CSS classes/styles for the BitSlider's upper value input.
ValueInput string? null Custom CSS classes/styles for the BitSlider's value input.
TrackInput string? null Custom CSS classes/styles for the input that makes the filled band of a ranged BitSlider draggable, which is only rendered while DraggableTrack asks for it.
OriginFromZero string? null Custom CSS classes/styles for the BitSlider's origin tick.
ValueLabel string? null Custom CSS classes/styles for the BitSlider's value label.
LowerValueLabel string? null Custom CSS classes/styles for the BitSlider's lower value label.
UpperValueLabel string? null Custom CSS classes/styles for the BitSlider's upper value label.
Mark string? null Custom CSS classes/styles for the BitSlider's mark ticks.
MarkLabel string? null Custom CSS classes/styles for the BitSlider's mark labels.
ThumbLabel string? null Custom CSS classes/styles for the BitSlider's floating thumb labels.

BitSliderRangeValue properties

Name Type Default value Description
Lower double 0 The lower value of the ranged Slider.
Upper double 0 The upper value of the ranged Slider.
Length double 0 The distance between the two ends of the range.

BitSliderMark properties

Name Type Default value Description
Value double 0 The value the mark sits at. A mark outside the Min..Max range of the slider is not rendered.
Label string? null The text rendered under the mark. A mark without one is drawn as a plain tick, unless ShowMarkLabels is on - which labels it with its own value - or a MarkLabelTemplate is supplying the content.
Class string? null Custom CSS classes for this mark, added to both its tick and its label.
Style string? null Custom CSS styles for this mark, added to both its tick and its label.

BitSliderThumbLabel enum

Name Value Description
Off 0 Never show the floating label.
Auto 1 Show the floating label only while the slider is being hovered, dragged or focused.
On 2 Always show the floating label.

BitSize enum

Name Value Description
Small 0 The small size.
Medium 1 The medium size.
Large 2 The large size.

BitColor enum

Name Value Description
Primary 0 Primary general color.
Secondary 1 Secondary general color.
Tertiary 2 Tertiary general color.
Info 3 Info general color.
Success 4 Success general color.
Warning 5 Warning general color.
SevereWarning 6 SevereWarning general color.
Error 7 Error general color.
PrimaryBackground 8 Primary background color.
SecondaryBackground 9 Secondary background color.
TertiaryBackground 10 Tertiary background color.
PrimaryForeground 11 Primary foreground color.
SecondaryForeground 12 Secondary foreground color.
TertiaryForeground 13 Tertiary foreground color.
PrimaryBorder 14 Primary border color.
SecondaryBorder 15 Secondary border color.
TertiaryBorder 16 Tertiary border color.

BitVisibility enum

Name Value Description
Visible 0 The content of the component is visible.
Hidden 1 The content of the component is hidden, but the space it takes on the page remains (visibility:hidden).
Collapsed 2 The component is hidden (display:none).

BitDir enum

Name Value Description
Ltr 0 Ltr (left to right) is to be used for languages that are written from the left to the right (like English).
Rtl 1 Rtl (right to left) is to be used for languages that are written from the right to the left (like Arabic).
Auto 2 Auto lets the user agent decide. It uses a basic algorithm as it parses the characters inside the element until it finds a character with a strong directionality, then applies that directionality to the whole element.

Feedback

Found a mistake, a gap, or something that could be clearer? Every page and every component is one click from its source.