Tag
A value someone chose or applied.
A value chip: something chosen or applied, like a country in a Multi-select or a filter on the guides library. Two sizes, sm 20 and md 24, with radius 4. Tags are values, not statuses (Badge) and not filters you open (Pill).
import { Tag } from "@commenda/meridian/ui/tag";
import { USFlag } from "@commenda/pathfinder/flags";
import type { ReactNode } from "react";
function Stage({ children }: { children: ReactNode }) {
return (
<div className="not-prose my-4 flex flex-wrap items-end gap-6 rounded-xl border border-fd-border bg-white p-8">
{children}
</div>
);
}
function Labelled({ label, children }: { label: string; children: ReactNode }) {
return (
<div className="flex flex-col items-center gap-2.5">
{children}
<span className="text-[12px] text-fd-muted-foreground">{label}</span>
</div>
);
}
const noop = () => {};
const remove = { onRemove: noop };
export function TagSizes() {
return (
<Stage>
<Labelled label="sm · 20">
<Tag label="United States" leadingIcon={<USFlag size={12} />} removeConfig={remove} />
</Labelled>
<Labelled label="md · 24">
<Tag
size="md"
label="United States"
leadingIcon={<USFlag size={12} />}
removeConfig={remove}
/>
</Labelled>
</Stage>
);
}Usage
import { Tag } from "@commenda/meridian/ui/tag";
import { USFlag } from "@commenda/pathfinder/flags";
<Tag label="United States" leadingIcon={<USFlag size={12} />} removeConfig={{ onRemove }} />;Sizes
sm 20 sits inside a 40 field and in dense lists. md 24 stands on its own, like filter chips above a list of guides.
import { Tag } from "@commenda/meridian/ui/tag";
import { USFlag } from "@commenda/pathfinder/flags";
import type { ReactNode } from "react";
function Stage({ children }: { children: ReactNode }) {
return (
<div className="not-prose my-4 flex flex-wrap items-end gap-6 rounded-xl border border-fd-border bg-white p-8">
{children}
</div>
);
}
function Labelled({ label, children }: { label: string; children: ReactNode }) {
return (
<div className="flex flex-col items-center gap-2.5">
{children}
<span className="text-[12px] text-fd-muted-foreground">{label}</span>
</div>
);
}
const noop = () => {};
const remove = { onRemove: noop };
export function TagSizes() {
return (
<Stage>
<Labelled label="sm · 20">
<Tag label="United States" leadingIcon={<USFlag size={12} />} removeConfig={remove} />
</Labelled>
<Labelled label="md · 24">
<Tag
size="md"
label="United States"
leadingIcon={<USFlag size={12} />}
removeConfig={remove}
/>
</Labelled>
</Stage>
);
}Removable or fixed
x removes the value. Turn it off where the value cannot be removed here, and for the +N count.
import { Tag } from "@commenda/meridian/ui/tag";
import { DEFlag, USFlag } from "@commenda/pathfinder/flags";
import type { ReactNode } from "react";
function Stage({ children }: { children: ReactNode }) {
return (
<div className="not-prose my-4 flex flex-wrap items-end gap-6 rounded-xl border border-fd-border bg-white p-8">
{children}
</div>
);
}
const noop = () => {};
const remove = { onRemove: noop };
export function TagRemovable() {
return (
<Stage>
<Tag label="United States" leadingIcon={<USFlag size={12} />} removeConfig={remove} />
<Tag label="Germany" leadingIcon={<DEFlag size={12} />} removeConfig={remove} />
<Tag label="Sales tax" />
<Tag label="+3" />
</Stage>
);
}Leading flag or icon
Countries and jurisdictions always lead with their 12 flag. A 12 icon is for other kinds of things, like a product or a topic.
import { Tag } from "@commenda/meridian/ui/tag";
import { GBFlag, INFlag, SGFlag } from "@commenda/pathfinder/flags";
import { Globe02Icon } from "@commenda/pathfinder/icons/Globe02Icon";
import type { ReactNode } from "react";
function Stage({ children }: { children: ReactNode }) {
return (
<div className="not-prose my-4 flex flex-wrap items-end gap-6 rounded-xl border border-fd-border bg-white p-8">
{children}
</div>
);
}
const noop = () => {};
const remove = { onRemove: noop };
export function TagLeading() {
return (
<Stage>
<Tag label="United Kingdom" leadingIcon={<GBFlag size={12} />} removeConfig={remove} />
<Tag label="India" leadingIcon={<INFlag size={12} />} removeConfig={remove} />
<Tag label="Singapore" leadingIcon={<SGFlag size={12} />} />
<Tag label="Transfer pricing" leadingIcon={<Globe02Icon size={12} />} removeConfig={remove} />
</Stage>
);
}Tones and states
Neutral for values people chose. Blue marks an applied filter, so people can see what is narrowing the list. Hover darkens one step. Disabled follows the field it sits in.
import { Tag } from "@commenda/meridian/ui/tag";
import { CAFlag } from "@commenda/pathfinder/flags";
import type { ReactNode } from "react";
function Stage({ children }: { children: ReactNode }) {
return (
<div className="not-prose my-4 flex flex-wrap items-end gap-6 rounded-xl border border-fd-border bg-white p-8">
{children}
</div>
);
}
function Labelled({ label, children }: { label: string; children: ReactNode }) {
return (
<div className="flex flex-col items-center gap-2.5">
{children}
<span className="text-[12px] text-fd-muted-foreground">{label}</span>
</div>
);
}
const noop = () => {};
const remove = { onRemove: noop };
export function TagTones() {
return (
<Stage>
<Labelled label="neutral">
<Tag label="Sales tax" removeConfig={remove} />
</Labelled>
<Labelled label="blue">
<Tag tone="blue" label="Sales tax" removeConfig={remove} />
</Labelled>
<Labelled label="disabled">
<Tag
label="Canada"
leadingIcon={<CAFlag size={12} />}
removeConfig={{ onRemove: noop, isDisabled: true }}
/>
</Labelled>
</Stage>
);
}Anatomy
Soft Pearl 200 fill with a 0.5 hairline, radius 4, 6 on the left and 4 on the right, 4 between parts. sm: 20 high, Label/12 in Soft Pearl 1000, x 12 in Soft Pearl 800. md: 24 high, Label/13.
API reference
| Prop | Type | Description |
|---|---|---|
labelRequired | string | From Pathfinder. |
size | "md" | "sm" | Figma size: sm 20 inside fields and dense lists, md 24 standing on its own. |
tone | "neutral" | "blue" | From Pathfinder. |
leadingIcon | ReactElement<unknown, string | JSXElementConstructor<any>> | From Pathfinder. |
removeConfig | ObjectView fields | From Pathfinder. |
className | string | From Pathfinder. |
id | string | From Pathfinder. |
removeConfigObject fields
| Field | Type | Description |
|---|---|---|
onRemoveRequired | () => void | |
label | string | |
isDisabled | boolean |
Best practices
- Use Tag for values someone chose or applied: countries in a Multi-select, filters on the guides library, topics on a post.
- A status (Live, New, Coming soon) is a Badge, not a Tag. Badges are read-only, colored by meaning and never removable. A filter people open is a Pill.
- Keep labels short. A Tag never wraps. Long names truncate with an ellipsis and show in full on hover.
- x removes the value at once. On a filter row, offer Clear all at the end.
- Countries always lead with their flag, and so do jurisdictions. Icons are for other kinds of things.
- Source: Pathfinder Tag. Meridian adds size md 24 beside Pathfinder’s 20, now sm.