Skip to content

Boolean column

Boolean fields show up often in admin tables — enabled flags, verification state, feature toggles. Orbit gives you three ways to display that state: icon check/X cells, the same icons via IconColumn, or plain Yes/No text.

BooleanColumn is a convenience column that is already an IconColumn with .boolean() applied — a check icon (success) when truthy, an X icon (danger) when falsy:

from almasix.orbit.tables import BooleanColumn
BooleanColumn.make("enabled")

BooleanColumn vs. IconColumn.boolean() vs. TextColumn.boolean()

Section titled “BooleanColumn vs. IconColumn.boolean() vs. TextColumn.boolean()”

All three read the same underlying state; they differ only in what renders:

API Renders
BooleanColumn.make(...) Check / X icons
IconColumn.make(...).boolean() Same icons — customize with .true_icon() / .false_icon()
TextColumn.make(...).boolean() "Yes" / "No" text
from almasix.orbit.tables import BooleanColumn, IconColumn, TextColumn
BooleanColumn.make("enabled")
IconColumn.make("verified").boolean().true_icon("heroicon-o-check")
TextColumn.make("featured").boolean()

Because BooleanColumn is an IconColumn, every icon column helper works on it directly:

BooleanColumn.make("verified")
.true_icon("heroicon-o-check")
.false_icon("heroicon-o-x-mark")
.true_color("info")
.false_color("gray")
from almasix.orbit.tables import Table, TextColumn, BooleanColumn, IconColumn
Table.make("features").columns([
TextColumn.make("name").searchable(),
BooleanColumn.make("enabled").sortable().align_center(),
IconColumn.make("verified")
.boolean()
.true_icon("heroicon-o-check")
.false_icon("heroicon-o-x-mark")
.align_center(),
TextColumn.make("beta").boolean().label("Beta?"),
]).records([
{"id": 1, "name": "Dark mode", "enabled": True, "verified": True, "beta": False},
{"id": 2, "name": "AI summaries", "enabled": False, "verified": False, "beta": True},
])
Method Effect
.boolean() Switch icon (or text, on TextColumn) mode on
.true_icon(...) / .false_icon(...) Heroicon names (IconColumn / BooleanColumn)
.true_color(...) / .false_color(...) Override the default success / danger colors
.size(...) Icon size class
.color(str | callable) Explicit color — wins over true/false color
.sortable() / .align_center() Inherited shared helpers

Boolean column (light) Boolean column (dark)

Icon / boolean (light) Icon / boolean (dark)