Labels over Pips
Each pip has an intrinsic value based on the min
and max
and its position
in the Slider. This value can be displayed as a label
over the pip
.
The labels are displayed using the all
, first
last
and rest
props.
Labels over All
Labels over First & Last
No Pips over Rest
Labels over Rest
Only nth Labels
There could be scenarios where you need to show all the pips (step=1
) but you only want to
display labels for odd steps, for example.
There’s two ways to achieve this,
- either with
css
styling, - or with the
formatter
function.
With CSS
This is the preferred method, as it’s more flexible and easier to maintain. The value remains in the markup, but it’s not visible.
With Formatter
Using a formatter will remove the value altogether from the markup.
Custom / Formatted Labels
Generally, if you want to display a custom label, you’ll want to use the formatter
function,
this allows you to display any string for the labels. Check out the formatter
examples for more info.