# nav_pill

URL: https://lbliii.github.io/chirp-ui/api/nav_pill/
Section: api
Description: Sliding-pill nav indicator helpers (#255).

Server-side CSS custom-property estimates for first paint; shell runtime
``syncPill()`` refines to measured pixels on client navigation.

---

> For a complete page index, fetch https://lbliii.github.io/chirp-ui/llms.txt.

Sliding-pill nav indicator helpers (#255).

Server-side CSS custom-property estimates for first paint; shell runtime
`syncPill()`refines to measured pixels on client navigation.

nav_pill

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

function
estimate_nav_item_width_em

Heuristic width in rem for SSR pill placement before client measurement.

Jump to symbol

(#estimate_nav_item_width_em)

function
nav_pill_inline_style

Return inline`style` for `--chirpui-pill-*`vars from item list.

Jump to symbol

(#nav_pill_inline_style)

function
segmented_pill_inline_style

Sliding pill offsets for segmented_control item dicts.

Jump to symbol

(#segmented_pill_inline_style)

estimate_nav_item_width_em

function

```
def estimate_nav_item_width_em(item: _PillItem, *, kind: str = 'route_tab') -> float
```

Heuristic width in rem for SSR pill placement before client measurement.

Parameters

Name

Type

Default

Description

`item`

`_PillItem`

—

`kind`

`str`

`'route_tab'`

nav_pill_inline_style

function

```
def nav_pill_inline_style(items: Iterable[_PillItem], current_path: str = '', is_active: Callable[[_PillItem, str], bool] | None = None, *, gap_em: float = 0.5, block_size_em: float = 2.0, match: str = 'route') -> str
```

Return inline`style` for `--chirpui-pill-*`vars from item list.

Parameters

Name

Type

Default

Description

`items`

`Iterable[_PillItem]`

—

`current_path`

`str`

`''`

`is_active`

`Callable[[_PillItem, str], bool] | None`

`None`

`gap_em`

`float`

`0.5`

`block_size_em`

`float`

`2.0`

`match`

`str`

`'route'`

segmented_pill_inline_style

function

```
def segmented_pill_inline_style(items: Iterable[_PillItem]) -> str
```

Sliding pill offsets for segmented_control item dicts.

Parameters

Name

Type

Default

Description

`items`

`Iterable[_PillItem]`

—

View source · /home/runner/work/chirp-ui/chirp-ui/site/../src/chirp_ui/nav_pill.py:1
(https://github.com/lbliii/chirp-ui/blob/main//home/runner/work/chirp-ui/chirp-ui/site/../src/chirp_ui/nav_pill.py#L1)
