#947
Delays and alignment
A two-item docs nav (Guides, Reference) that opens on hover at once and stays open 400 ms after the pointer leaves.
Hand this to your AI. It names the exact library parts, timings and accessibility promises of this demo.
Build the "Delays and alignment" pattern (@codeatlasdev/ui demo #947, navigation/navigation-menu) in my app.
Call get_demo({ ids: ["#947"] }) first and keep its structure. It needs @codeatlasdev/[email protected].
Use: Tuning how eager the hover behaviour is for dense navigation, and aligning each panel to its button's start or end.
Keep these library parts, with the props and tokens the demo uses:
- NavigationMenu, NavigationMenuItem, NavigationMenuLink from "@codeatlasdev/ui"
Behaviour to keep:
- `<NavigationMenu aria-label="Docs sections" openDelay={0} closeDelay={400}>`
- `<NavigationMenuItem label="Guides" align="start">` and `<NavigationMenuItem label="Reference" align="end">` align their panels to the button
- Each panel holds two `NavigationMenuLink`s
Reduced motion: the demo handles it; keep that branch.
Keyboard: operable; keep the focus order and key handling.
Change only the copy and the data. Use the theme tokens (--ca-*), never raw colours. Library parts
- NavigationMenu
@codeatlasdev/ui - NavigationMenuItem
@codeatlasdev/ui - NavigationMenuLink
@codeatlasdev/ui
How it is built
- `<NavigationMenu aria-label="Docs sections" openDelay={0} closeDelay={400}>`
- `<NavigationMenuItem label="Guides" align="start">` and `<NavigationMenuItem label="Reference" align="end">` align their panels to the button
- Each panel holds two `NavigationMenuLink`s
Related
Loading source.