AppNavbar

A floating nav capsule that darkens past the hero — labels fold shut without unmounting, and a single pill travels between links instead of fading in under each one.

Install: pnpm add-component AppNavbar

Live bar

A screen with its own scroller, so the contract can be demonstrated without scrolling this page. Every prop below is live.

Basic usage

Branding is a slot, so the bar carries whatever lockup you have. The slot receives `compact`, which is what lets a lockup clip back to its mark as the bar contracts.

Labels fold, they do not unmount

Each collapsing label stays in the DOM at max-width 0. Removing it would strip the control's accessible name the moment the bar contracts, leaving a screen reader with an icon and nothing else. The padding sits on an inner span, not the collapsing one — with border-box a padded box cannot be narrower than its own padding, so max-w-0 on a ps-2 span still measures 8px and pushes the icon off centre by exactly that much.

Inside an app shell

When the page scrolls inside a container rather than the document, hand the bar that container. Without it the bar reads the document's scroll offset, which never moves, and it stays at its resting size forever.

API