PolyHunter

Tags

Tag list built on the Tag atom — pass a list, closing animates out and the remaining tags reflow smoothly. Uncontrolled (defaultTags) or controlled (tags + onTagsChange).

Playground

Live preview

GuildLiveRareExpiringLocked

Examples

Uncontrolled

PendingSuccessFilter

Code

import { Tags, type TagItem } from "@npolyhunter/ui";

// Uncontrolled — the list manages itself, onTagsChange observes
<Tags
  defaultTags={[
    { id: "guild", label: "Guild", variant: "filter" },
    { id: "live", label: "Live", variant: "success" },
  ]}
  onTagsChange={(tags) => console.log(tags)}
/>

// Controlled — you own the list
const [tags, setTags] = React.useState<TagItem[]>(initialTags);
<Tags tags={tags} onTagsChange={setTags} />

Code

import { Tags, type TagItem } from "@npolyhunter/ui";

// Uncontrolled — the list manages itself, onTagsChange observes
<Tags
  defaultTags={[
    { id: "guild", label: "Guild", variant: "filter" },
    { id: "live", label: "Live", variant: "success" },
  ]}
  onTagsChange={(tags) => console.log(tags)}
/>

// Controlled — you own the list
const [tags, setTags] = React.useState<TagItem[]>(initialTags);
<Tags tags={tags} onTagsChange={setTags} />

Used in

No usage found outside previews and tests.

No usage found