# Meter

A labelled progress bar for a bounded quantity.

## Value

A `label`, a `value` and a `max`, 100 by default. `valuetext` words the value for the eye and for screen readers.

## Severities

A severity class tones the bar for how worrying the value is.

## Sizes

`thin` and `thick` set the bar's height.

## Examples

```svelte
<script lang="ts">
  import Meter from '@qualia-studios/design-ui/components/Meter.svelte';
</script>
```

### Example 1: A storage meter

```svelte
<div class="stack">
  <Meter label="Storage" value={64} max={100} />
</div>
```

### Example 2: Credits left, as value text

```svelte
<div class="stack">
  <Meter
    label="Credits"
    value={1250}
    max={5000}
    valuetext={({ value, max }) =>
      `${value.toLocaleString()} / ${max.toLocaleString()} credits`}
  />
</div>
```

### Example 3: Healthy and critical

```svelte
<div class="stack">
  <Meter label="Healthy" value={80} class="success" />
  <Meter label="Critical" value={15} class="danger" />
</div>
```

### Example 4: Info and warning

```svelte
<div class="stack">
  <Meter label="Filling up" value={60} class="info" />
  <Meter label="Watch out" value={40} class="warning" />
</div>
```

### Example 5: Three heights

```svelte
<div class="stack">
  <Meter label="Thin" value={50} class="thin" />
  <Meter label="Default" value={50} />
  <Meter label="Thick" value={50} class="thick" />
</div>
```

---

From the Qualia design guide: https://q-core-3b2732.gitlab.io/components/meter. Every page as markdown: https://q-core-3b2732.gitlab.io/llms.txt
