Components
Tag
Removable or clickable chips with the same visual language as Badge.
Tag is a chip for removable or clickable labels. It shares variants, sizes, shapes, icons, and
custom colors with Badge, but owns the interactive and remove behavior.
Badge remains the choice for read-only status, status dots, and counts.
Use Badge when the label is informational. Use Tag when the label can be removed or selected.
Live preview#
DesignEngineeringProduct
import { Stack, Tag } from '@orkest/ui';
export function Example() {
return (
<Stack direction="row" gap={2} wrap>
<Tag>Design</Tag>
<Tag variant="info">Engineering</Tag>
<Tag variant="outline">Product</Tag>
</Stack>
);
}Variants#
DefaultInfoSuccessWarningDestructiveOutline
import { Stack, Tag } from '@orkest/ui';
export function Example() {
return (
<Stack direction="row" gap={2} wrap>
<Tag>Default</Tag>
<Tag variant="info">Info</Tag>
<Tag variant="success">Success</Tag>
<Tag variant="warning">Warning</Tag>
<Tag variant="destructive">Destructive</Tag>
<Tag variant="outline">Outline</Tag>
</Stack>
);
}Sizes and shapes#
Tags are pill-shaped by default. Set shape="rounded" for a tighter corner.
SmallMediumLargeRounded
import { Stack, Tag } from '@orkest/ui';
export function Example() {
return (
<Stack direction="row" gap={2} align="center" wrap>
<Tag size="sm">Small</Tag>
<Tag size="md">Medium</Tag>
<Tag size="lg">Large</Tag>
<Tag shape="rounded">Rounded</Tag>
</Stack>
);
}Icons#
InfoDone
import { Stack, Tag } from '@orkest/ui';
import { Check, Circle } from 'lucide-react';
export function Example() {
return (
<Stack direction="row" gap={2} align="center" wrap>
<Tag variant="info" leftIcon={Circle}>
Info
</Tag>
<Tag variant="success" rightIcon={Check}>
Done
</Tag>
</Stack>
);
}Removable#
Removable tags stay non-interactive as a whole so the remove action can be a native button.
DesignEngineeringProduct
import { useState } from 'react';
import { Stack, Tag } from '@orkest/ui';
export function Example() {
const [tags, setTags] = useState(['Design', 'Engineering']);
return (
<Stack direction="row" gap={2} wrap>
{tags.map((tag) => (
<Tag
key={tag}
removable
onRemove={() => setTags((current) => current.filter((item) => item !== tag))}
>
{tag}
</Tag>
))}
</Stack>
);
}Interactive#
import { useState } from 'react';
import { Tag } from '@orkest/ui';
export function Example() {
const [active, setActive] = useState(false);
return (
<Tag
interactive
variant={active ? 'success' : 'outline'}
onClick={() => setActive((value) => !value)}
>
{active ? 'Selected' : 'Select tag'}
</Tag>
);
}Custom color#
Custom
import { Tag } from '@orkest/ui';
export function Example() {
return <Tag color="#7c3aed">Custom</Tag>;
}Props#
| Prop | Type | Default |
|---|---|---|
variant | 'default' | 'info' | 'success' | 'warning' | 'destructive' | 'outline' | 'default' |
| Semantic color treatment. | ||
size | 'sm' | 'md' | 'lg' | 'md' |
| Control height, font size, radius, and icon size. | ||
shape | 'rounded' | 'pill' | 'pill' |
| Corner treatment. | ||
leftIcon | LucideIcon | — |
| Decorative icon rendered before the content. | ||
rightIcon | LucideIcon | — |
| Decorative icon rendered after the content. | ||
color | string | — |
| Custom CSS color used as a tinted tag accent. | ||
removable | boolean | false |
| Shows a remove action. Removable tags render as a span, not a button. | ||
onRemove | () => void | — |
| Called when the remove action is pressed. | ||
removeLabel | string | 'Remove' |
| Accessible name for the remove action. | ||
interactive | boolean | false |
| Renders a native button with keyboard and focus behavior. Ignored when removable. | ||
disabled | boolean | false |
| Disables interactive tags and their remove action. | ||
native attributes | HTMLAttributes<HTMLElement> | — |
| ARIA attributes, event handlers, className, style, and ref are forwarded. | ||
Accessibility#
- Static tags render a
span; interactive tags render a native<button type="button">. - Removable tags keep the root non-interactive so the remove action can be a native button.
interactiveis ignored whenremovableis set. - The remove action has an accessible name from
removeLabel. - Interactive tags support keyboard activation and a focus-visible ring.
- Icons are decorative and hidden from assistive technology.
- Do not communicate status with color alone. Pair variants, dots, and custom colors with text.
- Check contrast when using custom colors.