# BarList

A compact ranked list of named values on one scale.

Connect Flood once using [the installation guide](https://flood.md/docs/installation). Then import the components you use; no per-component add command is needed.

## Example

```tsx
"use client";

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

export function Example() {
  return (
    <FloodRoot>
      <BarList label="Visits by page" items={[
        {id:"overview", label:"Overview", value:214},
        {id:"components", label:"Components", value:136}
      ]} />
    </FloodRoot>
  );
}
```

## Design notes

- Sort items before passing them in. The list preserves display order and uses a shared zero baseline. Pass the same max to compare separate lists.
- Each item uses a proportional background bar from Flood Meter. Labels and exact values share one row and stay aligned across the list. Supply valueText for units or localized formatting.

## API reference

| Prop | Values | Default |
| --- | --- | --- |
| `label` | `string` | `Required` |
| `items` | `readonly BarListItem[]` | `Required` |
| `max` | `number` | `—` |
| `tone` | `"neutral" \| "accent" \| "error" \| "warning" \| "success" \| "info"` | `"accent"` |
| `emptyLabel` | `string` | `"No data"` |
| `Native HTML props` | `Omit<HTMLAttributes<HTMLDivElement>, "children" \| "role" \| "aria-label">` | `Forwarded` |
