Pill
A compact glass label for status, categories and optional actions.
Usage
Draft
Ready
Featured
<script>
import { Pill } from 'bref-ui';
</script>
<Pill label="Ready" color="success" variant="soft" />
Playground
Live preview
Status
Settings
View generated code
<script>
import { Pill } from 'bref-ui';
</script>
<Pill
label={'Status'}
size="medium"
variant="neutral"
color="foreground"
wide={false}
glass={false}
swoosh={false}
icon={{ name: 'star', filled: false }}
title="Native title attribute"
/>
Sizes, colors and variants
Interactions and snippets
Clickable
Removable
Combined
Animated
Content snippet
Clicks: 0; removals: 0
Full-width Pill
neutral
primary
secondary
foreground
muted
info
success
warning
error
soft
primary
secondary
foreground
muted
info
success
warning
error
filled
primary
secondary
foreground
muted
info
success
warning
error
Sizes and long content
x-small
x-small
small
small
medium
medium
large
large
x-large
x-large
A long category label that wraps on a narrow screen without losing its meaning
Glass over a patterned background
Compare glass and regular Pills over a swirling, striped background.
neutral
Without glass
Glass
Removable
soft
Without glass
Glass
Removable
filled
Without glass
Glass
Removable
<Pill label="Glass" color="primary" glass />
Props and native behavior
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
label | string | Yes | — | Visible label. |
icon | Omit<IconProps, 'label' | 'size' | 'color'> | No | Omitted | Decorative leading icon. |
children | Snippet | No | Omitted | Visible content. |
size | Size | No | medium | Five sizes from x-small to x-large. |
variant | Variant | No | neutral | neutral, soft or filled. |
color | Exclude<Color, 'background'> | No | foreground | Theme role. |
onClick | (event: MouseEvent) => void | No | Omitted | Activate the Pill. |
onDelete | () => void | No | Omitted | Show a labeled remove button. |
wide | boolean | No | false | Fill the available width. |
swoosh | boolean | No | false | Animate the highlight. |
glass | boolean | No | false | Translucent paint and backdrop blur. |
Pill accepts native div attributes and a children snippet. A clickable Pill supports Enter and Space; its remove button has a separate accessible name.