Skip to content
v0.2.10

Meter

A measured value within a meaningful, finite range.

Preview
Storage used

Use Meter

Meter is a named export of @flood-md/react. Connect the package once, then import what you use.

First time here? Connect Flood
Example import style
meter.tsxTSX
"use client";

import { FloodRoot, Meter } from "@flood-md/react";
import "@flood-md/react/styles.css";

export function Example() {
  return (
    <FloodRoot>
      <Meter label="Storage used" value={75} valueText="75 of 100 GB" />
    </FloodRoot>
  );
}

Design notes

  • Use Meter for storage, battery or other bounded measurements; use Progress for task completion.
  • Value is required. Min defaults to 0 and max to 100; require min < max and min <= value <= max. Invalid values throw.
  • Use valueText for meaningful units; hideLabel keeps the accessible name. Tone is host-owned and does not calculate warning thresholds.
  • Native div props, className/style and ref target the wrapper. Available in 0.2.4.

API reference

PropValuesDefault
labelstringRequired
maxnumber100
valueTextstring—
size"sm" | "md" | "lg""md"
tone"neutral" | "accent" | "error" | "warning" | "success" | "info""neutral"
hideLabelbooleanfalse
valuenumberRequired
minnumber0
Native HTML propsOmit<Omit<HTMLAttributes<HTMLDivElement>, "children" | "role">, "value">Forwarded
View TypeScript source