Meter

A reading inside a known range, like storage or quota, with its label and value on one line over the track.

01Preview

01
Full screen
Messages this week
x
File storage
x
Context used
x

02Installation

npx shadcn@latest add https://aiellie.app/r/meter.json

03API reference

05
From the Base UI documentation

Groups all parts of the meter and provides the value for screen readers. Renders a <div> element.

Props

PropTypeDefaultDescription
value\*number-The current value.
aria-valuetextstring-A string value that provides a user-friendly name for aria-valuenow, the current value of the meter.
getAriaValueText((formattedValue: string, value: number) => string)-A function that returns a string value that provides a human-readable text alternative for aria-valuenow, the current value of the meter.
localeIntl.LocalesArgument-The locale used by Intl.NumberFormat when formatting the value. Defaults to the user's runtime locale.
minnumber0The minimum value
maxnumber100The maximum value
formatIntl.NumberFormatOptions-Options to format the value.
classNamestring | ((state: Meter.Root.State) => string | undefined)-CSS class applied to the element, or a function that returns a class based on the component's state.
styleReact.CSSProperties | ((state: Meter.Root.State) => React.CSSProperties | undefined)-Style applied to the element, or a function that returns a style object based on the component's state.
renderReactElement | ((props: HTMLProps, state: Meter.Root.State) => ReactElement)-Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render.