Installation#
npmpnpmyarnbun
Examples#
Default#
Default
With Label#
With Label
Sizes#
Available in multiple sizes.
Sizes
Colors#
Meter supports different color variants for semantic meaning.
Colors
Custom Range#
Use min and max to define custom ranges.
Custom Range
Storage Usage Example#
Storage Usage
Anatomy#
Usage#
Import
import { Meter } from "@sugarcoat/ui-nxt";Usage
<Meter value={75} color="primary" size="md">
<Meter.Label>75% Complete</Meter.Label>
<Meter.Track>
<Meter.Indicator />
</Meter.Track>
</Meter>Props#
Meter (Root)#
| Prop | Type | Default | Description |
|---|---|---|---|
| value | number | - | Current value of the meter |
| min | number | 0 | Minimum value |
| max | number | 100 | Maximum value |
| size | "sm" | "md" | "lg" | "md" | Size of the meter |
| color | "default" | "primary" | "success" | "warning" | "danger" | "primary" | Color variant |
| css | SystemStyleObject | - | Additional CSS styles using Panda CSS syntax |
Accessibility#
- Built on Base UI Meter for robust accessibility
- Uses
role="meter"with proper ARIA attributes aria-valuenow,aria-valuemin, andaria-valuemaxare set automatically- Use
Meter.Labeloraria-labelto provide context