base-ui icon indicating copy to clipboard operation
base-ui copied to clipboard

[Meter][Progress][Slider] Unify formatting API

Open mj12albert opened this issue 2 months ago • 7 comments

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:

mj12albert avatar Dec 05 '24 05:12 mj12albert