> ## Documentation Index
> Fetch the complete documentation index at: https://api.fanvue.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Tag

> A small label for something the user applied, such as a fan tag, a list or an active filter.

```tsx theme={null}
import { Tag } from "@fanvue/ui";
import type { TagProps, TagRemoveVisibility, TagSize, TagVariant } from "@fanvue/ui";
```

## Examples

## Default

[Tag — Default](https://main--697a1b6dd4dad73ee9c0e5f5.chromatic.com/iframe.html?id=components-tag--default\&viewMode=story\&shortcuts=false\&singleStory=true\&globals=theme:light)

```tsx theme={null}
import { Tag } from "@fanvue/ui";

<Tag leadingIcon="🐳" variant="blue">Whale</Tag>
```

## Truncated

[Tag — Truncated](https://main--697a1b6dd4dad73ee9c0e5f5.chromatic.com/iframe.html?id=components-tag--truncated\&viewMode=story\&shortcuts=false\&singleStory=true\&globals=theme:light)

```tsx theme={null}
import { Tag } from "@fanvue/ui";

<Tag className="max-w-40" onRemove={() => {}} removeLabel="Remove tag">A very long tag label that does not fit</Tag>
```

## All Colours

[Tag — All Colours](https://main--697a1b6dd4dad73ee9c0e5f5.chromatic.com/iframe.html?id=components-tag--all-colours\&viewMode=story\&shortcuts=false\&singleStory=true\&globals=theme:light)

```tsx theme={null}
import { Fragment } from "react";
import { Tag } from "@fanvue/ui";
import type { TagSize, TagVariant } from "@fanvue/ui";

const VARIANTS: readonly TagVariant[] = [
  "gray",
  "blue",
  "teal",
  "green",
  "amber",
  "red",
  "pink",
  "purple",
];

const SIZES: readonly TagSize[] = ["16", "20"];

<div className="grid w-max grid-cols-[repeat(3,max-content)] items-center justify-items-start gap-x-8 gap-y-3">
  {SIZES.map((size) => (
    <Fragment key={size}>
      {VARIANTS.map((variant) => (
        <Fragment key={variant}>
          <span className="typography-description-12px-semibold text-content-tertiary capitalize">
            {variant} {size}px
          </span>
          <Tag variant={variant} size={size} leadingIcon="🐳">
            Whale
          </Tag>
          <Tag
            variant={variant}
            size={size}
            leadingIcon="🐳"
            onRemove={() => {}}
            removeLabel="Remove Whale"
          >
            Whale
          </Tag>
        </Fragment>
      ))}
    </Fragment>
  ))}
</div>
```

## Removable

[Tag — Removable](https://main--697a1b6dd4dad73ee9c0e5f5.chromatic.com/iframe.html?id=components-tag--removable\&viewMode=story\&shortcuts=false\&singleStory=true\&globals=theme:light)

```tsx theme={null}
import { Tag } from "@fanvue/ui";

<Tag
  leadingIcon="🐳"
  variant="blue"
  onRemove={() => {}}
  removeLabel="Remove Whale"
  removeVisibility="hover"
>
  Whale
</Tag>
```

## Props

## Tag

A small label for something the user applied, such as a fan tag, a list or an active filter. Status labels belong in `Pill` or `Badge`.

Pass `onRemove` to add a × button. The label is plain text, and the × is a real button named by `removeLabel`, so nothing interactive is nested inside the tag except the ×.

**children** `ReactNode` *required*

The visible label.

**leadingIcon** `ReactNode`

Emoji (a string) or icon (an element) displayed before the label. Decorative, so it is hidden from assistive technology. Size an icon yourself: 14px on a 20px tag (`className="size-3.5"`) and 12px on a 16px tag (`className="size-3"`).

**onRemove** `((event: MouseEvent\<HTMLButtonElement, MouseEvent\>) =\> void)`

Renders a remove (×) button when set. Receives the click, so a caller can stop it bubbling. Pass `undefined` to hide the button conditionally while keeping `removeLabel`. Leave unset for a tag with no remove button.

**removeLabel** `string`

Accessible name of the remove button, as one translated string such as "Remove Whale". Only used with `onRemove`.

**removeVisibility** `"hover" | "always"` (default: always)

`"always"` keeps the × visible (lists, filter tags). `"hover"` reveals it on hover or keyboard focus, and keeps it visible on devices that cannot hover. In `"hover"` mode the tag is narrower at rest and widens when the × appears; its height never changes. Only used with `onRemove`.

**size** `"16" | "20"` (default: 20)

Height in pixels: 16 for dense rows, 20 for panels, pickers and filter tags.

**variant** `"pink" | "red" | "teal" | "green" | "blue" | "gray" | "amber" | "purple"` (default: gray)

Colour from the V2 Tags palette.

## Exported types

Also exported from `@fanvue/ui`: `TagProps`, `TagRemoveVisibility`, `TagSize`, `TagVariant`.

***

**Setup:** [Installation](https://api.fanvue.com/docs/ui/installation.md) · [Theming](https://api.fanvue.com/docs/ui/theming.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.