base-ui
base-ui copied to clipboard
[Meter][Progress][Slider] Unify formatting API
NumberField uses Intl.NumberFormat
, we can follow the format
prop and adapt it for these range widgets:
Meter/Progress:
A formatted value will be announced to SRs using aria-valuetext
but there is no element that displays a formatted value to sighted users (like Slider.Output
), should we add something like Meter.Value
? It could follow the API of Select.Value
Slider:
To output something like 25.00 - 75.00 US dollars
, format
can optionally be an array for range sliders:
<Slider
value={[10, 20]
format={[options1, options2]}}
/>
// or format both values identically
<Slider
value={[10, 20]
format={formatOptions}
/>
Search keywords: