Tag

Tag is a compact label used to categorize, classify, or annotate content with color-coded visual styles.

Design
Research
Q4 launch
tsx
import { Tag } from '@/components/ui/wideset/tag/Tag';

<Tag>Design</Tag>
<Tag>Research</Tag>
<Tag>Q4 launch</Tag>

Installation

pnpm dlx wideset add tag

Copies the component and any Wideset components it uses into your project.

Examples

Colors

Tag colours are categorical, not semantic: they tell categories apart (a project, a team, a topic) and say nothing about success or danger, which is Status badge's job. Give each category one colour and keep it everywhere; secondary is the neutral fallback.

tsx
import { Tag } from '@/components/ui/wideset/tag/Tag';

const tags = [
  ['brand', 'Wideset'],
  ['red', 'Marketing'],
  ['pink', 'Brand'],
  ['violet', 'Research'],
  ['purple', 'Design'],
  ['indigo', 'Platform'],
  ['blue', 'Engineering'],
  ['cyan', 'Data'],
  ['teal', 'Support'],
  ['green', 'Finance'],
  ['lime', 'Growth'],
  ['yellow', 'Legal'],
  ['orange', 'Sales'],
  ['secondary', 'Other'],
] as const;

export default function TagColors() {
  return (
    <div className="gap-ws-8 flex flex-wrap items-center">
      {tags.map(([color, label]) => (
        <Tag key={color} color={color}>
          {label}
        </Tag>
      ))}
    </div>
  );
}

Presets

Filled has a solid tint and stands out in lists and cards. Border keeps only the outline, for long rows of tags or busy layouts where filled tags would compete with the content. Use one preset per list.

tsx
import { Tag } from '@/components/ui/wideset/tag/Tag';

export default function TagPresets() {
  return (
    <div className="gap-ws-8 flex flex-wrap items-center">
      <Tag preset="filled">Design</Tag>
      <Tag preset="border">Design</Tag>
    </div>
  );
}

Sizes

Medium is the default. Small fits table cells and dense lists; large sits next to larger text, such as a card title. Tags in one row share a size.

tsx
import { Tag } from '@/components/ui/wideset/tag/Tag';

export default function TagSizes() {
  return (
    <div className="gap-ws-8 flex flex-wrap items-center">
      {(['sm', 'md', 'lg'] as const).map((size) => (
        <Tag key={size} size={size}>
          Design
        </Tag>
      ))}
    </div>
  );
}

Shapes

Square is the default and lines up with other rectangular elements such as inputs and table cells. Rounded is a pill, a softer look for tags on cards and profiles. Pick one shape per product.

tsx
import { Tag } from '@/components/ui/wideset/tag/Tag';

export default function TagShapes() {
  return (
    <div className="gap-ws-8 flex flex-wrap items-center">
      <Tag shape="square">Design</Tag>
      <Tag shape="rounded">Design</Tag>
    </div>
  );
}

Icons

A leading icon helps the eye find a category in a long list. The icon is hidden from screen readers, so an iconOnly tag needs its name in text: put it in a visually hidden span, or the tag says nothing at all.

tsx
import { RiFlashlightFill } from '@remixicon/react';
import { Tag } from '@/components/ui/wideset/tag/Tag';

export default function TagIcons() {
  return (
    <div className="gap-ws-8 flex flex-wrap items-center">
      <Tag>
        <Tag.Icon icon={RiFlashlightFill} />
        Quick win
      </Tag>
      <Tag iconOnly>
        <Tag.Icon icon={RiFlashlightFill} />
        <span className="sr-only">Quick win</span>
      </Tag>
    </div>
  );
}

API reference

Tag

NameDescriptionDefault
color
'blue''purple''pink''orange''lime''teal''brand''violet''red''yellow''green''cyan''indigo''secondary'
'brand'
iconOnly

When true, renders the tag as an icon-only variant with equal padding on all sides.

boolean
false
preset
'border''filled'
'filled'
shape
'rounded''square'
'square'
size
'sm''md''lg'
'md'
truncate

When true, truncates overflowing text with an ellipsis.

boolean
false
Every other prop of <div> is passed through to it. See MDN: <div>.

Tag.Icon

NameDescriptionDefault
icon*

Icon component from `@remixicon/react`.

RemixiconComponentType
—
Every other prop of <div> is passed through to it. See MDN: <div>.

Accessibility

  • Tag is a div with plain text; it is not focusable and has no role.
  • Tag.Icon is hidden from screen readers. An iconOnly tag needs its name in a sr-only span.
  • Colour alone never carries meaning; the label does.
PartRendersDescription
Tag<div>A compact descriptive label with optional icon.
Tag.Icon<div>An icon rendered within `Tag`.
Design
Research
Q4 launch
tsx
import { Tag } from '@/components/ui/wideset/tag/Tag';

<Tag>Design</Tag>
<Tag>Research</Tag>
<Tag>Q4 launch</Tag>

Appearance

Style
Color
Shape
Size
Icon only

Content

Icon