Import Histogram Slider and compose its parts.
histogram-slider.tsx
HistogramSlider
<div>| Prop | Type | Default | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| class | string | — | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| thumb | Omit<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. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| glow | boolean | — | A soft halo in the fill color (glow, @gelatin-ui/glow). Default: false. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| data | readonly number[] | — | Raw values (prices, sizes), counted into bins bins from min to max. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| counts | readonly number[] | — | Ready bin counts from min to max, when the server counts them. Wins over data. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| bins | number | 32 | The number of bins for data. Default 32. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| size | "default""lg""sm" | "default" | The bar area height: sm 32, default 48, lg 64px. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| read | boolean | false | No change from the pointer, the keys, or the fields. The bars still show. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| on | — | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| on | — | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| labels | — | The words (HISTOGRAM_SLIDER_LABELS), to translate them. Keep the object stable. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
From Base UISlider.RootBase UI docs | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| default | HistogramSliderValue | — | The uncontrolled value of the slider when it's initially rendered. To render a controlled slider, use the value prop instead. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| disabled | boolean | false | Whether the slider should ignore user interaction. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| format | NumberFormatOptions | — | Options to format the value. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
HistogramSliderControl
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| class | string | — | |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
HistogramSliderBars
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
HistogramSliderEnds
<div>HistogramSliderSummary
<span>| Prop | Type | Default | Description |
|---|---|---|---|
| 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>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
| Arrow keys | Move the focused thumb by one step. |
|---|---|
| Page UporPage Down | Move the focused thumb by largeStep. |
| HomeorEnd | Move the focused thumb to the minimum or the maximum. |
Built with
Installs with Histogram Slider
- Components
- Field,Number Field,Slider





