Xzero UI
Pro library

Chip group

Filter by a few facets with chips that morph as you pick them.

$ pnpm dlx shadcn@4.23.0 add @xzero-ui/chip-group
Live · keyboard ready

When to use

When not to use

Installation

Register both Xzero UI namespaces in your project's components.json:

{
  "registries": {
    "@xzero-ui": "https://mcp.xzero.co.uk/r/{name}.json",
    "@xzero-ui-pro": "https://mcp.xzero.co.uk/r/pro/{name}.json"
  }
}
npx shadcn@4.23.0 add @xzero-ui/chip-group

Install xzero-foundation once, and import @/components/xzero/foundation.css in your app root. No Xzero token is used by this snapshot. For sample portraits, photos, fonts, or logos, download https://mcp.xzero.co.uk/install-assets.mjs and run node xzero-install-assets.mjs <receiving-project>.

Usage

import { ChipGroup } from "@/components/xzero/chip-group/chip-group";

export function TopicFilter() {
  const [topics, setTopics] = useState<string[]>([]);
  return (
    <ChipGroup
      label="Topics"
      value={topics}
      onValueChange={setTopics}
      maxVisible={4}
      options={["Design", "Motion", "Code", "Research", "Writing"].map((t) => ({ value: t.toLowerCase(), label: t }))}
    />
  );
}

API reference

ChipGroup

Toggleable filter chips that morph when selected and fold long sets behind a +N more chip.

PropTypeDefaultDescription
options (required){ value: string; label: string }[]–Chips in order.
value (required)string[]–Selected values.
onValueChange (required)(value: string[]) => void–Called with the new selection, in option order.
label (required)string–Accessible name of the group, such as "Topics".
multiplebooleantrueAllow several chips. In single mode the selected chip can still be cleared.
maxVisiblenumberInfinityChips shown before the rest fold. Selected chips always stay in view.
classNamestring–Added to the group.

Keyboard interactions

KeysAction
Arrow keysMove focus between chips and the more chip, wrapping.
Home / EndFocus the first or last chip.
Enter / SpaceToggles the focused chip or opens the overflow.

Accessibility

Motion

Responsive behavior

Performance

Notes for AI

Also in selects

Guidance for AI tools

Chip group: Filter by a few facets with chips that morph as you pick them. Follow the declared prop types and do not invent props. Keep keyboard access, reduced motion support, and both light and dark themes intact when adapting it.

Full library index: https://ui.xzero.co.uk/llms.txt

Browse all components