Dot Price Range
Each bar of dots stands for a slice of the price range, as tall as the number of things at that price, so you can see where the prices bunch before you choose. Bars inside the range light as the thumbs pass and the count under it updates. Drag a thumb, press the track to bring the nearer one there, use the arrow keys, or type a price; the top end can mean "and up".
Needs: None. One canvas.
Customize
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| min | number | required | The lowest price. |
| max | number | required | The highest price. |
| step | number | 1 | What prices snap to. |
| value | [number, number] | – | Controlled range. Leave unset to let it keep its own. |
| defaultValue | [number, number] | "[min, max]" | Range at first, when uncontrolled. |
| onChange | (range) => void | – | Called as it moves. |
| onCommit | (range) => void | – | Called once a move is done. Fetch results here. |
| prices | number[] | – | Prices of what's filtered: the histogram, and the count. |
| noun | string | "results" | What the results are called in the count. |
| currency | string | "$" | Before every price. |
| openEnded | boolean | true | The top end means and up: $500+. |
| gap | number | 0 | The smallest the range can close to. |
| tone | string | – | The lit bars' and track's colour. The page's accent by default. |
| pitch | number | 4 | Size of one dot, px. |
| className | string | – | Class on the filter. |
| style | CSSProperties | – | Style on the filter. |