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? }.
route_tabs
| Name | Type | Default | Description |
|---|---|---|---|
type
|
|
— | |
qualified_name
|
|
— | |
element_type
|
|
— | |
description
|
|
— | |
source_file
|
|
— | |
line_number
|
|
— | |
is_autodoc
|
|
— | |
autodoc_element
|
|
— | |
_autodoc_template
|
|
— | |
_autodoc_url_path
|
|
— | |
_autodoc_page_type
|
|
— | |
title
|
|
— | |
doc_content_hash
|
|
— |
Symbols on this page
_get_attr
function
def _get_attr(tab: dict[str, Any] | object, key: str, default: str = '') -> str
Get href or match from tab (dict or object).
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
tab
|
dict[str, Any] | object
|
— | |
key
|
str
|
— | |
default
|
str
|
''
|
tab_is_active
function
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". Returns False when href is empty (prevents prefix match against all paths).
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
tab
|
dict | object
|
— | |
current_path
|
str
|
— |
View source · /home/runner/work/chirp-ui/chirp-ui/site/../src/chirp_ui/route_tabs.py:1