# Meter

A segmented gauge with thresholds that change its tone and print a word.

[View Meter on CyberSpec](https://www.cyberspec.dev/components/sidebar/meter)

## Component

Meter belongs to the Data group in the CyberSpec catalog. It uses @ui-sdk/react/meter.

## Installation

Use a React 19 project with shadcn configured. Render the installed components inside the Cyber root, and import your global stylesheet in the app entry point.

```sh
bunx --bun shadcn@latest add https://www.cyberspec.dev/r/meter.json
```

## Example

```tsx
"use client"

import { Meter } from "@/components/ui/meter"

export default function MeterDemo() {
  return (
    <>
      <Meter label="Deck memory" value={10} max={50} />
      <Meter label="Heat" value={93} high={85} />
      <Meter label="Reserve cell" value={12} low={20} high={90} format={{ style: "percent" }} />
    </>
  )
}
```

## Install this example

```sh
bunx --bun shadcn@latest add https://www.cyberspec.dev/r/meter-demo.json
```

## Resources

- [Interactive Meter preview](https://www.cyberspec.dev/preview/meter)
- [Component catalog](https://www.cyberspec.dev/components.md)
- [Meter source code](https://github.com/agnelnieves/cyberspec/blob/main/registry/cyber/ui/meter.tsx)
- [Shadcn registry item](https://www.cyberspec.dev/r/meter.json)
