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

# Tag

> Label a category or attribute with a theme color and optional icon.

export const StoryEmbed = ({storyId, title, height = 240}) => <>
    <Tabs>
      <Tab title="Light">
        <iframe title={`${title} (light)`} src={`https://storybook.twenty.com/iframe.html?id=${storyId}&viewMode=story&globals=colorScheme:light`} width="100%" height={height} loading="lazy" style={{
  border: 0
}} />
      </Tab>
      <Tab title="Dark">
        <iframe title={`${title} (dark)`} src={`https://storybook.twenty.com/iframe.html?id=${storyId}&viewMode=story&globals=colorScheme:dark`} width="100%" height={height} loading="lazy" style={{
  border: 0
}} />
      </Tab>
    </Tabs>
    <a href={`https://storybook.twenty.com/?path=/story/${storyId}`}>
      Open in Storybook
    </a>
  </>;

Use `Tag` for categories, priorities, or other short attributes. Keep a text label so the meaning does not depend on color. Use [Status](/ui/primitives/data-display/status) when you need a state indicator and loading feedback.

<StoryEmbed storyId="ui-data-display-tag--documentation" title="Tag example" />

## Category label

```tsx theme={null}
import { Tag } from 'twenty-ui/primitives/data-display';

export const PriorityTag = () => <Tag color="red">Urgent</Tag>;
```

`color` is required and accepts a theme color or `transparent`. The default element is a `span`. Add a decorative icon with `startIcon`; the label supplies its accessible meaning.

## Variants

```tsx theme={null}
import { Tag } from 'twenty-ui/primitives/data-display';

export const CategoryTags = () => (
  <div style={{ display: 'flex', flexWrap: 'wrap', gap: 8 }}>
    <Tag color="blue" variant="soft">
      Customer
    </Tag>
    <Tag color="green" variant="solid">
      Partner
    </Tag>
    <Tag color="orange" variant="outline">
      Prospect
    </Tag>
    <Tag color="transparent" variant="outline" borderStyle="dashed">
      Unassigned
    </Tag>
  </div>
);
```

`soft` is the default treatment. `solid` emphasizes the label, `outline` adds a border, and `ghost` removes the background. Use `borderStyle="dashed"` with `outline` and `weight="medium"` for a stronger label.

## Filter by a tag

```tsx theme={null}
import { Tag } from 'twenty-ui/primitives/data-display';

type CategoryFilterProps = {
  selected: boolean;
  onToggle: () => void;
};

export const CategoryFilter = ({ selected, onToggle }: CategoryFilterProps) => (
  <Tag
    color="blue"
    variant={selected ? 'solid' : 'outline'}
    aria-pressed={selected}
    onClick={onToggle}
  >
    Customer
  </Tag>
);
```

Supplying `onClick` renders a button. Selection state belongs to your application; use `aria-pressed` for a toggle and a visible treatment for the selected state. `disabled` prevents pointer and keyboard activation. When `render` replaces an interactive tag with a non-button element, set `nativeButton={false}`.

## Long labels

By default, constrained string labels truncate and expose their full text in a tooltip on hover. `preventShrink` keeps the full label width and turns off that tooltip, so make sure the surrounding layout can accommodate it. `preventPadding` removes the horizontal padding for custom layouts.

## Props

Types and defaults are generated from the public component types. Native attributes and event handlers are also accepted.

<ParamField body="borderStyle" type="&#x22;solid&#x22; | &#x22;dashed&#x22;" default="solid">
  Border style used by the outline variant.
</ParamField>

<ParamField body="color" type="&#x22;ruby&#x22; | &#x22;red&#x22; | &#x22;crimson&#x22; | &#x22;tomato&#x22; | &#x22;orange&#x22; | &#x22;amber&#x22; | &#x22;yellow&#x22; | &#x22;lime&#x22; | &#x22;grass&#x22; | &#x22;green&#x22; | &#x22;jade&#x22; | &#x22;mint&#x22; | &#x22;turquoise&#x22; | &#x22;cyan&#x22; | &#x22;sky&#x22; | &#x22;blue&#x22; | &#x22;iris&#x22; | &#x22;violet&#x22; | &#x22;purple&#x22; | &#x22;plum&#x22; | &#x22;pink&#x22; | &#x22;bronze&#x22; | &#x22;gold&#x22; | &#x22;brown&#x22; | &#x22;gray&#x22; | &#x22;transparent&#x22;" required>
  Theme color for the tag, or `transparent` for an unfilled label.
</ParamField>

<ParamField body="disabled" type="boolean" default="false">
  Applies disabled styling and prevents pointer and keyboard activation.
</ParamField>

<ParamField body="nativeButton" type="boolean" default="true">
  Set to `false` when a clickable tag uses `render` with an element other than a native button.
</ParamField>

<ParamField body="preventPadding" type="boolean" default="false">
  Removes the tag padding.
</ParamField>

<ParamField body="preventShrink" type="boolean" default="false">
  Keeps the tag from shrinking and disables string-label truncation and its tooltip.
</ParamField>

<ParamField body="render" type="ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, {}>">
  Allows you to replace the component's HTML element
  with a different tag, or compose it with another component.

  Accepts a `ReactElement` or a function that returns the element to render.
</ParamField>

<ParamField body="startIcon" type="ReactNode">
  Decorative icon before the label. Hidden from assistive technology.
</ParamField>

<ParamField body="variant" type="&#x22;solid&#x22; | &#x22;outline&#x22; | &#x22;soft&#x22; | &#x22;ghost&#x22;" default="soft">
  Visual treatment of the tag background and border.
</ParamField>

<ParamField body="weight" type="&#x22;regular&#x22; | &#x22;medium&#x22;" default="regular">
  Font weight of the label.
</ParamField>
