Examples

Removable filters

The remove button is named “Remove {label}”.

Preview
Example.tsx
import { HStack, Tag } from '@reactloom/ui';
import { useState } from 'react';

export default function Example() {
  const [filters, setFilters] = useState(['Finance', 'Q3 2026', 'EU region']);
  return (
    <HStack gap="2" wrap>
      {filters.map((f) => (
        <Tag key={f} onRemove={() => setFilters(filters.filter((x) => x !== f))}>
          {f}
        </Tag>
      ))}
      {filters.length === 0 && <span>All filters cleared.</span>}
    </HStack>
  );
}

Tones and icons

Preview
Example.tsx
import { HStack, Tag } from '@reactloom/ui';
import { Tag as TagIcon } from 'lucide-react';

export default function Example() {
  return (
    <HStack gap="2" wrap>
      <Tag icon={<TagIcon />}>Enterprise</Tag>
      <Tag tone="info">API</Tag>
      <Tag tone="success">Verified</Tag>
      <Tag tone="warning" size="sm">Expiring</Tag>
      <Tag tone="danger" size="sm">Blocked</Tag>
    </HStack>
  );
}

API reference

Tag props
PropTypeDefault
tone
'neutral' | 'info' | 'success' | 'warning' | 'danger''neutral'
size
'sm' | 'md''md'
icon
Decorative leading content.
ReactNode—
onRemove
Shows a remove button.
() => void—
removeLabel
Required when children is not plain text.
string“Remove {children}”
disabled
booleanfalse

Customization

Extracted from the component’s source on every build, so it matches the code. How the layers fit together is explained in Customization.

State attributes

Target these in your CSS to style states without depending on class names.

AttributeValues
[data-disabled]present when on
[data-size]sm · md
[data-tone]neutral · info · success · warning · danger

Theme tokens it reads

--pl-color-bg-inverse --pl-color-bg-subtle --pl-color-border-default --pl-color-danger-border --pl-color-danger-fg --pl-color-danger-on-solid --pl-color-danger-solid --pl-color-danger-subtle --pl-color-fg-default --pl-color-fg-inverse --pl-color-info-border --pl-color-info-fg --pl-color-info-on-solid --pl-color-info-solid --pl-color-info-subtle --pl-color-success-border --pl-color-success-fg --pl-color-success-on-solid --pl-color-success-solid --pl-color-success-subtle --pl-color-warning-border --pl-color-warning-fg --pl-color-warning-on-solid --pl-color-warning-solid --pl-color-warning-subtle --pl-focus-ring-color --pl-focus-ring-width --pl-font-size-sm --pl-font-size-xs --pl-radius-sm --pl-radius-xs

Accessibility

  • The remove control is a real button with a specific accessible name.
  • After removing a tag, move focus to a sensible place (the next tag or the filter input).
Keyboard interactions
KeyAction
TabReach the remove button
Enter / SpaceRemove

Usage guidelines

Do

  • Use tags for user-applied categories and active filters.

Don’t

  • Don’t use tags for status — use Badge.