Skip to content

Histogram Slider

Free

A range slider with bars above it that show how the values spread. Use it for a price, size, or duration filter, with raw values or bin counts.

  • Base UI
  • React 19
  • Tailwind CSS 4

Added Nov 10, 2026 · MIT + Commons Clause

Playground

Loading the preview

Props

Import Histogram Slider and compose its parts.

histogram-slider.tsx

HistogramSlider

<div>
PropTypeDefaultDescription
classNamestring—
thumbPropsOmit<SliderThumbProps, "index">—Props for every default thumb: getAriaLabel, getAriaValueText, aria-label, disabled.
tone"destructive""info""neutral""success""warning"—default: the primary fill. A status colors the fill and the thumb edge: success a good value, warning a value that needs care, info a neutral mark, destructive a value over a limit. Color is never the only signal: say it in words too.
glowboolean—A soft halo in the fill color (glow, @gelatin-ui/glow). Default: false.
datareadonly number[]—Raw values (prices, sizes), counted into bins bins from min to max.
countsreadonly number[]—Ready bin counts from min to max, when the server counts them. Wins over data.
binsnumber32The number of bins for data. Default 32.
size"default""lg""sm""default"The bar area height: sm 32, default 48, lg 64px.
readOnlybooleanfalseNo change from the pointer, the keys, or the fields. The bars still show.
onValueChange—
onValueCommitted—
labels—The words (HISTOGRAM_SLIDER_LABELS), to translate them. Keep the object stable.
From Base UISlider.RootBase UI docs
defaultValueHistogramSliderValue—The uncontrolled value of the slider when it's initially rendered. To render a controlled slider, use the value prop instead.
disabledbooleanfalseWhether the slider should ignore user interaction.
formatNumberFormatOptions—Options to format the value.
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

HistogramSliderControl

<div>
PropTypeDefaultDescription
classNamestring—
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

HistogramSliderBars

<div>
PropTypeDefaultDescription
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

HistogramSliderEnds

<div>
PropTypeDefaultDescription
startReactNode—The start label. Default: min in the root format.
endReactNode—The end label. Default: max in the root format (pass "$1,000+" for an open end).
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

HistogramSliderSummary

<span>
PropTypeDefaultDescription
children—The text. Default: "84 of 212", and "120 – 140 · 6" while the pointer is on a bar. Pass a function to name the things ("84 of 212 stays").
...props<span> attributes—Every other attribute goes to the <span>, with a ref.

HistogramSliderInputs

<div>
PropTypeDefaultDescription
...props<div> attributes—Every other attribute goes to the <div>, with a ref.
  • Use it for price, size, or duration filters.
  • Use counts when a server sends ready bins, and data for raw values.
  • For a value with no data spread, use a Slider.
Arrow keysMove the focused thumb by one step.
Page UporPage DownMove the focused thumb by largeStep.
HomeorEndMove the focused thumb to the minimum or the maximum.

Each thumb is a native range input. In a range they are named Minimum and Maximum; translate the names with labels.

The value text of a thumb adds the count in range, such as "$120, 84 of 212 in range".

The bars are a picture and are hidden from screen readers; the summary says the same count.

The Min and Max fields commit on Enter or blur, so the thumb does not jump while you type.

New data
panel · each bar grows or shrinks from its old height
Drag
none · the bright bars follow the thumbs with no transition

Built with

Installs with Histogram Slider

  1. AddedHistogram Slider, with Field, Number Field, Slider.
Open the release