ValyroUI Русская версия

Histogram Range

Price range with a histogram, two thumbs and inputs. Pro · Forms and input › Checkboxes and sliders

Installation

npx valyro-cli@latest login
npx valyro-cli@latest add histogram-range
npm install valyro-ui-pro

import 'valyro-ui-pro/styles.css';
import { HistogramRange } from 'valyro-ui-pro';

Props

PropTypeDefault
histogram *number[]Counts per bucket, evenly spread from min to max (e.g. listings per price step).
min *numberLowest selectable value.
max *numberHighest selectable value.
stepnumber1Granularity of the thumbs and the fields. Default 1.
value[number, number]Selected range (controlled).
defaultValue[number, number]Initial value when uncontrolled.
onValueChange(value: [number, number]) => voidCalled with the new value when it changes.
prefixReactNodeText before the numbers in the fields: "
quot;, "₽".
suffixReactNodeText after the numbers in the fields: "kg", "₽".
showInputsbooleantrueShows the two number fields under the slider. Default true.
histogramHeightnumber56Height of the histogram in px. Default 56.
formatValue(value: number) => stringFormats values for the thumbs' screen reader text.
namestringForm field name; the range submits as two values.
localestringBCP 47 locale for the numbers in the fields.
disabledbooleanfalseDisables the whole control.
labelsPartial<HistogramRangeLabels>Overrides for the built-in English text; keys left out keep their defaults.

Related components

Previous: Slider · Next: Rating Input · All Forms and input