---
layout: ~/layouts/MdxDocLayout.astro
title: "Meter"
description: "A progress/percentage meter component for displaying numeric values within a known range."
sourceFile: "components/meter"
---

import ComponentExample from "~/components/docs/ComponentExample.astro";
import ComponentSection from "~/components/docs/ComponentSection.astro";
import PropsTable from "~/components/docs/PropsTable.astro";
import {
  MeterBasicDemo,
  MeterCustomValueDemo,
  MeterHiddenValueDemo,
  MeterFullDemo,
  MeterLowDemo,
} from "~/components/demos/MeterDemo";

{/* Hero Demo */}

<ComponentSection>
  <ComponentExample demo="MeterBasicDemo">
    <MeterBasicDemo client:visible />
  </ComponentExample>
</ComponentSection>

{/* Installation */}

<ComponentSection>

## Installation

### Barrel

```tsx
import { Meter } from "@cloudflare/kumo";
```

### Granular

```tsx
import { Meter } from "@cloudflare/kumo/components/meter";
```

</ComponentSection>

{/* Usage */}

<ComponentSection>

## Usage

```tsx
import { Meter } from "@cloudflare/kumo";

export default function Example() {
  return <Meter label="Storage used" value={65} />;
}
```

</ComponentSection>

{/* Examples */}

<ComponentSection>

## Examples

### Basic Meter

<p>The default meter displays a label and percentage value.</p>
<ComponentExample demo="MeterBasicDemo">
  <MeterBasicDemo client:visible />
</ComponentExample>

### Custom Value Display

<p>Use `customValue` to show a custom string instead of the percentage.</p>
<ComponentExample demo="MeterCustomValueDemo">
  <MeterCustomValueDemo client:visible />
</ComponentExample>

### Hidden Value

<p>Set `showValue={false}` to hide the value display.</p>
<ComponentExample demo="MeterHiddenValueDemo">
  <MeterHiddenValueDemo client:visible />
</ComponentExample>

### Full Meter

<p>A meter at 100% capacity.</p>
<ComponentExample demo="MeterFullDemo">
  <MeterFullDemo client:visible />
</ComponentExample>

### Low Value

<p>A meter with a low value.</p>
<ComponentExample demo="MeterLowDemo">
  <MeterLowDemo client:visible />
</ComponentExample>

</ComponentSection>

{/* API Reference */}

<ComponentSection>

## API Reference

  <PropsTable component="Meter" />
</ComponentSection>
