Pill
Pill — internal base component for pill-shaped UI elements. This is a noop: it applies shared variant styling and renders children. Not intended for direct use in application code. Use Badge (presentational) or Tag (interactive) instead.
Usage
import { Pill, PILL_EMPHASES, PILL_ICON_SIZE_MAP, PILL_SIZES, PILL_TONES, PillEmphasis, PillProps, PillSize, PillTone, pillVariants } from "@desk/ui/components/pill";Best practices
Don't reach for
Pillin app code — it's the shared styling base; useBadgefor display-only labels/counts andTagfor interactive (clickable/dismissible) chips.Pillis presentation-only and has no button semantics or dismiss/click handling — those live onTag; addingonClickhere yields a non-accessible pseudo-button.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| as | React.ElementType<any, keyof React.JSX.IntrinsicElements> | "span" | Render element. |
| disabled | boolean | ||
| size | ResponsiveSize | null | undefined | "base" | Pill size — a single token or a per-breakpoint object like
|
| tone | "neutral" | "brand" | "danger" | "warning" | "success" | "info" | null | undefined | ||
| radius | "rounded" | "square" | "full" | null | undefined | ||
| emphasis | "outline" | "solid" | "ghost" | "soft" | "transparent" | null | undefined | ||
| asInput | boolean | null | undefined | Input-style chip: white bg + subtle shadow (unselected state). |
Also exports
- const
PILL_EMPHASES - const
PILL_ICON_SIZE_MAP - const
PILL_SIZES - const
PILL_TONES - type
PillEmphasis - interface
PillProps - type
PillSize - type
PillTone - const
pillVariants
Composition
Used by