An input range slider lets the user specify a numeric value which must be between two specified values.
The slider component is built using a native input form element with the attribute type of "range".
Implementation Notes and Requirements
slds-slidershould be applied to the div containing both the
<span>that holds the value of the
slds-slider__rangeshould be applied to the
<input>should have a unique ID that matches the
forattribute on the form element
slds-slider__rangeelement can accept 4 atrributes that describe the input range:
- value: Current value of the input range
- min: Minimum value of a specified range
- max: Maximum value of a specified range
- step: Indicates the granularity that is expected by limiting the allowed values
slds-slider__valuespan should be updated with the current value of the
slds-slider__valueelement must have
aria-hidden=trueto hide from screen readers as they understand that value already from the
- The class
slds-assistive-textcan be placed on the
<label>, or either
<label>, to visually hide the either value (or both).
Overview of CSS Classes
- The CSS class being referred to.
- A description of what the class does.
- Whether the class name is dev-ready (meaning it's fully vetted and tested and safe to use) or prototype (which means it's not fully vetted yet).
- The selector that the class name is allowed to be used on.
- The base level pattern for a component. A variant can be extended to create another variant of that component, for example, a stateful button is a derivative of the base button.
- A single class that can be added to an HTML element of a component to modify its output. Typically these will be colors, sizing and positioning.