Skip to content

Tabs

Tabs splits a form or infolist into horizontal panels. Each tab owns its own nested schema. Icons and badges surface counts or status without leaving the page.

app/orbit/schemas/tabs_basic.py
from almasix.orbit.schemas import Tabs
from almasix.orbit.forms import TextInput, Textarea
Tabs.make("main")
.tabs(
{"label": "General", "schema": [TextInput.make("title")]},
{"label": "SEO", "schema": [Textarea.make("meta_description")]},
)
.active_tab(0)

Basic tabs (light) Basic tabs (dark)

.tabs(...) accepts either dicts or (label, components) tuples:

app/orbit/schemas/tabs_defs.py
Tabs.make("main").tabs(
("Account", [TextInput.make("email")]),
("Profile", [TextInput.make("display_name")]),
)
Tabs.make("main").tabs(
{
"label": "SEO",
"icon": "heroicon-o-magnifying-glass",
"badge": "3",
"schema": [TextInput.make("slug")],
},
)

Dict keys: label (or id), schema / components, optional icon, optional badge (string or callable).

app/orbit/schemas/tabs_badges.py
Tabs.make("main")
.tabs({
"label": "SEO",
"icon": "heroicon-o-magnifying-glass",
"badge": "3",
"schema": [...],
})

Tabs with badges (light) Tabs with badges (dark)

Tabs overview (light) Tabs overview (dark)

app/orbit/schemas/tabs_persist.py
Tabs.make("settings")
.tabs(...)
.active_tab(1) # zero-based initial tab
.persist_tab() # data-persist-tab for the host
Method Role
.tabs One or more tab defs (dict or (label, schema) tuple)
.active_tab Zero-based initially selected tab
.persist_tab Persist the active tab in the host
.schema Extra children outside tab defs (rare)