Module

route_tabs

Route-family tab helpers for chirp-ui route_tabs component.

Tab item: dict or object withhref, optional match (default "exact"). Full dict shape (from ChirpTabItem via _tab_item_to_shell_dict): { label, href, icon?, badge?, match? }.

Functions

_get_attr 3 str
Get href or match from tab (dict or object).
def _get_attr(tab: dict[str, Any] | object, key: str, default: str = '') -> str
Parameters
Name Type Description
tab dict[str, Any] | object
key str
default str Default:''
Returns
str
tab_is_active 2 bool
Return True when tab matches current_path. Tab must have href. Optionally has …
def tab_is_active(tab: dict | object, current_path: str) -> bool

Return True when tab matches current_path.

Tab must have href. Optionally has match: "exact" | "prefix".

Parameters
Name Type Description
tab dict | object
current_path str
Returns
bool