# TagGroup

A wrapping group of labels or removable tags with optional count disclosure.

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, TagGroup } from "@flood-md/react";
import "@flood-md/react/styles.css";

export function Example() {
  return (
    <FloodRoot>
      <TagGroup label="Project filters" items={[{id:"status",label:"Status: Active"},{id:"owner",label:"Owner: Maya"},{id:"team",label:"Team: Design"}]} maxVisibleTags={2} />
    </FloodRoot>
  );
}
```

## Design notes

- Use for accepted labels or filter summaries. Use TagInput to create values and MultiSelect to choose values.
- Provide a group label and stable unique item IDs. Pass onRemove to request removal by ID. Update items after acceptance. Supply removeLabel for localized removal and disabled on individual protected tags.
- maxVisibleTags keeps a short preview with an expandable count. Localize moreTagsLabel and fewerTagsLabel. A disabled group displays every label and blocks removal.
- Choose the same size as nearby tags. The group wraps between tags and keeps long labels readable at narrow widths.
- For identity groups, provide each item's avatar data and keep the name as its visible label.

## API reference

| Prop | Values | Default |
| --- | --- | --- |
| `label` | `string` | `Required` |
| `items` | `readonly TagGroupItem[]` | `Required` |
| `size` | `"sm" \| "md" \| "lg"` | `—` |
| `disabled` | `boolean` | `—` |
| `onRemove` | `(id: string) => void` | `—` |
| `maxVisibleTags` | `number` | `—` |
| `moreTagsLabel` | `(hiddenCount: number) => string` | `—` |
| `fewerTagsLabel` | `string` | `—` |
| `Native HTML props` | `Omit<HTMLAttributes<HTMLUListElement>, "children">` | `Forwarded` |
