Badges, labels, and composite badges for status display and categorization.
Badge Sizes Reference
| Size | Class | Font Size | Padding | Example |
|---|---|---|---|---|
| XS |
.pa-badge--xs
| 1rem (10px) | 0.2rem 0.4rem | Extra Small |
| SM |
.pa-badge--sm
| 1.2rem (12px) | 0.25rem 0.5rem | Small Badge |
| Default |
.pa-badge
| 1.2rem (12px) | 0.4rem 0.8rem | Default Badge |
| LG |
.pa-badge--lg
| 1.4rem (14px) | 0.5rem 1rem | Large Badge |
| XL |
.pa-badge--xl
| 1.6rem (16px) | 0.6rem 1.2rem | Extra Large |
Basic Badges
Simple badges for status indication and categorization
Default Badges
Small Badges
Pill Badges
Rounded badges for a softer, modern appearance
Regular Pills
Small Pills
Badges with Icons
Enhanced badges with icon indicators
Label Sizes Reference
| Size | Class | Font Size | Padding | Example |
|---|---|---|---|---|
| XS |
.pa-label--xs
| 1rem (10px) | 0.2rem 0.4rem | Extra Small |
| SM |
.pa-label--sm
| 1.2rem (12px) | 0.25rem 0.5rem | Small Label |
| Default |
.pa-label
| 1.2rem (12px) | 0.4rem 0.8rem | Default Label |
| LG |
.pa-label--lg
| 1.4rem (14px) | 0.5rem 1rem | Large Label |
Labels
Text labels for categorization and tagging
Basic Labels
Outlined Labels
Badge Groups with Limits
Display many badges with automatic overflow handling - shows 5 badges and "... N more" indicator
Server-side: Project Tags (15 total, click loads from server)
Client-side: User Skills (7 total, JS toggle, no server round-trip)
Client-side: Status Badges (8 total, small size)
on_toggle="event_name" for server-side loading (fires LiveView event). Omit it for client-side JS toggle (no round-trip). Both support limit, total, and translatable more_text/collapse_text.
Narrow Container
Full Width Comparison
Wrapping Demo (Static)
Full Width Comparison
Fixed-Width Badges with Ellipsis
Badges with constrained width show ellipsis for overflow text. Hover for tooltip with full text.
Various Fixed Widths
Small Fixed-Width Badges
Practical Example: Tags with Consistent Width
Start-Side Ellipsis (Path/Hierarchy Display)
When the important part is at the end (breadcrumbs, file paths, etc.)
max_width="5" etc. to constrain badge width with truncation. Use is_ellipsis_start to truncate from the start side instead.
Composite Badges
Three-part badges with separate icon, label, and button sections
Standard Color Variations
More Examples
Advanced: Mixed Section Colors
For advanced customization, you can mix individual section colors using separate classes.
Interactive Composite Badges
Examples with click handlers and dynamic behavior
on_label_click and on_button_click attrs with separate LiveView events.
Usage Examples
Real-world examples of badges and labels in context