Import
Usage
Anatomy
Pill extends Badge with additional sub-components:Pill- Root component (extends Badge)Pill.Icon- Icon element with automatic sizingPill.Indicator- Status dot with optional pulse animationPill.Status- Predefined status indicatorPill.Delta- Value change indicator with directional stylingPill.Avatar- Embedded avatarPill.AvatarGroup- Multiple avatarsPill.Button- Dismissible action button
Props
Pill
variant
'default' | 'secondary' | 'outline' | 'ghost' | 'link' | 'success' | 'warning' | 'info' | 'danger'
default:"default"
Inherited from Badge. Determines the pill’s color scheme.
Controls the pill size with adjusted padding for rounded appearance:
xs- Gap 1, px 2, py 0.5sm- Gap 1.5, px 2.5, py 1md- Gap 2, px 3, py 1.5lg- Gap 2.5, px 3.5, py 1.5xl- Gap 3, px 4, py 2
Additional CSS classes to apply.
Pill.Icon
The Hugeicons icon component to render.
Additional CSS classes. Icon size adapts to pill size automatically.
Pill.Indicator
Determines the indicator color:
success- Green indicatorerror- Red indicatorwarning- Yellow/orange indicatorinfo- Blue indicator
When true, adds a pulsing animation to the indicator.
Pill.Status
Predefined status component using Pill.Indicator internally.Pill.Delta
The numeric change value. Positive values show increase, negative show decrease.
Additional CSS classes.
Pill.Avatar
Embeds an Avatar component with appropriate sizing.Pill.AvatarGroup
Embeds an AvatarGroup with appropriate sizing.Pill.Button
Click handler for the button action.
Additional CSS classes.
Examples
With icon
With status indicator
With delta
Show value changes with automatic directional styling:With avatar
Dismissible pill
Multiple sizes
Filter tags
Data Attributes
Inherits all data attributes from Badge:[data-size]- Reflects current size[data-slot]- Value is “badge”[data-variant]- Reflects current variant
Accessibility
- Inherits Badge accessibility features
- Interactive Pill.Button should have accessible labels
- Status indicators use color plus text for clarity
- Icon-only pills should include
aria-label