Skip to content

Navigation Menu

Site navigation made of links and disclosure buttons that open panels of links - on hover with intent, on click and from the keyboard - with an optional shared viewport, an indicator and directional motion.

Styled with CSS Tailwind

Basic with an indicator

Disclosure buttons and links in a <nav>: hover opens after DelayDuration, click / Enter / Space toggle, ↓ moves into the content, Escape returns to the trigger. Open states are styled with data-[state=open]:; the BitBhNavigationMenuIndicator follows the open trigger through left-[var(--bit-bh-indicator-left)] and fades with data-[state=hidden]:.

Viewport and motion

The contents move into a BitBhNavigationMenuViewport that takes the open one's size (w-[var(--bit-bh-navigation-menu-viewport-width)]) and animates between sizes. Contents slide in from the side of the previously open item and out to the other with data-[motion=from-end]: / data-[motion=to-start]: and starting: - plain transitions, no keyframes.

An unhandled error has occurred. Reload 🗙