Status Badge
StatusBadge builds on Badge with semantic status names, optional icons, and optional dot indicators.
Use it anywhere a status label should read consistently across dashboards, tables, cards, and activity feeds.
Import
Basic Usage
StatusBadge("Live", status="success")
StatusBadge("Pending", status="pending")
StatusBadge("Failed", status="error")
Dot Style
Badge Groups
Usage Scenarios
Data Table Row
DataTable(
data=[
{"name": "Alice", "status": "active"},
{"name": "Bob", "status": "pending"},
],
columns=["name", "status"],
render_status=lambda row: StatusBadge(
row["status"].title(),
status=row["status"],
),
)
Card Footer
Card(
Card.Body("Project deployment completed."),
Card.Footer(
StatusBadge("Deployed", status="success"),
StatusBadge("Reviewed", status="info"),
),
)
Custom Icons
Status Mapping
| Status | Default Variant | Default Icon |
|---|---|---|
success |
success |
check-circle-fill |
error |
danger |
x-circle-fill |
warning |
warning |
exclamation-triangle-fill |
info |
info |
info-circle-fill |
pending |
warning |
clock-fill |
neutral |
secondary |
none |
Accessibility
StatusBadgeuses semantic color/status mapping; ensure sufficient contrast for dot indicators.- The
pilloption increases the touch target size for mobile UIs.
Parameters
| Param | Type | Description |
|---|---|---|
label |
str |
Badge text. |
status |
success | error | warning | info | pending | neutral |
Semantic status name. |
variant |
str | None |
Bootstrap variant override. |
icon |
str | None |
Bootstrap icon override. Set "" to suppress the default icon. |
show_dot |
bool |
Show a dot before the label. |
pill |
bool |
Use rounded pill styling. |
faststrap.components.display.status_badge.StatusBadge(label, *, status='neutral', variant=None, icon=None, show_dot=False, pill=True, **kwargs)
Render a semantic status badge.
Source code in src/faststrap/components/display/status_badge.py
faststrap.components.display.status_badge.BadgeGroup(*badges, gap=2, align='center', **kwargs)
Render a wrapping group of badges or chips.