Badge column
BadgeColumn is a thin subclass of TextColumn with .badge() already applied. Use it when a column is always a status, tier, or label — you get every TextColumn helper (color, icon, format, sort, search) without having to remember .badge():
from almasix.orbit.tables import BadgeColumn
BadgeColumn.make("status").color( lambda state=None, **_: {"open": "warning", "closed": "success", "blocked": "danger"}.get( state, "gray", ),)BadgeColumn vs. TextColumn.badge()
Section titled “BadgeColumn vs. TextColumn.badge()”Both produce identical markup:
TextColumn.make("status").badge().color("primary")# renders the same as:BadgeColumn.make("status").color("primary")Prefer BadgeColumn when the column is always a badge — it documents intent at a glance. Prefer TextColumn.badge() (with a boolean or callable condition) when the same column sometimes renders as plain text, e.g. only badging non-default states.
Adding an icon
Section titled “Adding an icon”BadgeColumn supports every TextColumn helper, including icons:
BadgeColumn.make("priority").icon("heroicon-o-exclamation-triangle").color("danger")Full example
Section titled “Full example”from almasix.orbit.tables import Table, TextColumn, BadgeColumn
Table.make("tickets").columns([ TextColumn.make("subject").searchable(), BadgeColumn.make("status").sortable().color( lambda state=None, **_: {"open": "warning", "closed": "success"}.get(state, "gray"), ), BadgeColumn.make("priority").color("primary"),]).records([ {"id": 1, "subject": "Payments down", "status": "open", "priority": "urgent"}, {"id": 2, "subject": "Typo on homepage", "status": "closed", "priority": "low"},])Key methods
Section titled “Key methods”| Method | Effect |
|---|---|
.color(str | callable) |
Badge background color |
.icon(...) / .icon_position(...) |
Icon inside the badge |
.format_state_using(callback) |
Map raw values → labels |
.sortable() / .searchable() / .toggleable(...) |
Inherited shared helpers |
.align_center() |
Center the badge |
Inherited from TextColumn |
.limit(...), .copyable(), .weight(...), … |
Preview
Section titled “Preview”

