Meter
Meter is used to display finite value that are within a known range eg., CPU usage.
Imports
import {
Meter,
MeterBar,
MeterBarWrapper,
MeterHint,
MeterLabel,
useMeterProps,
useMeterState,
MeterTrack,
MeterWrapper,
} from "@renderlesskit/react-tailwind";
💡
A complex component that supports customization as per the composition guide.
Usage
Meter sizes
Sizes can be set using the size
prop. The default size is md
. The available
sizes are: sm
md
lg
xl
Min max values
Set the min
and max
values of the progress bar.
Meter Label
Meter also comes with A11y label that can also be used to describe the meter.
Meter Hint
Meter comes with A11y hint that can be used with label to indicate the meter status.
Meter Interval
Meter has an interval that can be used to indicate multiple range of the meter.
Customizing Meter
To customize the appearance of the Meter component we can simply pass down children components (MeterTrack, MeterBar) for more control.
API Reference
Prop | Type | Default |
---|---|---|
size | union | md |
intervals | number | - |
flatBorders | boolean | - |
hint | React.ReactNode | - |
label | React.ReactNode | - |
Last updated on July 18, 2022