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

<RangeSlider pips all="label" />
Labels over All
0 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 100

Labels over First & Last

<RangeSlider pips first="label" last="label" />
Labels over First & Last
0 100

No Pips over Rest

<RangeSlider pips all="label" rest={false} />
No Pips over Rest
0 100

Labels over Rest

<RangeSlider pips rest="label" />
Labels over Rest
5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95

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,

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.

#odd-only .rsPip:nth-child(odd) .rsPipVal {
  display: none;
}
Only Odd Labels
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

With Formatter

Using a formatter will remove the value altogether from the markup.

<RangeSlider pips all="label" max={20} 
  formatter={(v) => {
    return v % 2 === 0 ? v : ' ';
  }} 
/>
  
Only Even Labels
0 2 4 6 8 10 12 14 16 18 20

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.

<RangeSlider pips all="label" max={11} 
  formatter={(v) => {
    return new Date(2025, v).toLocaleString("en", { month: "short" });
  }}
/>
  
Labels as Months
Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec