Skip to content

Components

TagGroup

  • Status: Active
  • Owner: Maya Chen

Component reference

Properties

Use TagGroup

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

Example import style
tag-group.tsxTSX
"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

PropValuesDefault
labelstringRequired
itemsreadonly TagGroupItem[]Required
size"sm" | "md" | "lg"—
disabledboolean—
onRemove(id: string) => void—
maxVisibleTagsnumber—
moreTagsLabel(hiddenCount: number) => string—
fewerTagsLabelstring—
Native HTML propsOmit<HTMLAttributes<HTMLUListElement>, "children">Forwarded
View TypeScript source