navius

Navigation Menu

A collection of links for navigating websites.

Features

  • Can be controlled (@bind-Value) or uncontrolled (DefaultValue).
  • Full keyboard navigation with arrow-key roving across the trigger row.
  • Hover opens after OpenDelay; sweeping across triggers switches instantly while open.
  • Supports horizontal and vertical orientation, plus nested Sub menus.
  • Optional resizing Viewport and an Arrow that the positioner keeps pointed at the active trigger.
  • Renders as a <nav> landmark: site navigation, not a menu widget.

Installation

Install the brain, or copy just this primitive in with the CLI.

Anatomy

Import the parts and assemble them.

API Reference

Contains all the parts of a navigation menu and owns the open value. Renders a nav.

Prop Type Default
Value string? -
ValueChanged EventCallback<string?> -
DefaultValue string? -
Orientation string "horizontal"
OpenDelay int 200
CloseDelay int 300
SkipDelayDuration int 300
ChildContent RenderFragment? -
Data attribute Values
[data-orientation] "horizontal" | "vertical"

The top-level list of items, aligned along the edge of the active content. Renders a ul.

Prop Type Default
ChildContent RenderFragment? -
Data attribute Values
[data-orientation] "horizontal" | "vertical"

A single list item holding either a Trigger + Content pair or a top-level Link. Renders an li.

Prop Type Default
Value string ""
ChildContent RenderFragment? -
Data attribute Values
[data-orientation] "horizontal" | "vertical"

The button that discloses its item's content. Renders a button.

Prop Type Default
Disabled bool false
ChildContent RenderFragment? -
Data attribute Values
[data-popup-open] Present while the item's content is open.
[data-orientation] "horizontal" | "vertical"
[data-disabled] Present when disabled

The panel disclosed by a trigger. Self-anchors as a popover, or teleports into a Viewport when one is present. Renders a div.

Prop Type Default
Side string "bottom"
Align string "start"
SideOffset double 8
AlignOffset double 0
Flip bool true
ForceMount bool false
OnEscapeKeyDown EventCallback<NaviusEscapeKeyDownEventArgs> -
OnPointerDownOutside EventCallback<NaviusPointerDownOutsideEventArgs> -
OnFocusOutside EventCallback<NaviusFocusOutsideEventArgs> -
OnInteractOutside EventCallback<NaviusInteractOutsideEventArgs> -
ChildContent RenderFragment? -
Data attribute Values
[data-open] Present while open.
[data-closed] Present while closing (through the exit transition).
[data-orientation] "horizontal" | "vertical"
[data-activation-direction] "left" | "right" | "up" | "down" (direction of the previously active item)

A navigational anchor, used as a top-level item or inside a Content panel. Renders an a.

Prop Type Default
Href string? -
Active bool false
OnSelect EventCallback<NaviusSelectEventArgs> -
ChildContent RenderFragment? -
Data attribute Values
[data-active] Present when Active (also sets aria-current="page")

A marker inside the Popup that the positioner keeps pointed at the active trigger. Replaces the former Indicator; no state tracking is needed. Renders an svg.

Prop Type Default
Width double 10
Height double 5
ChildContent RenderFragment? -
Attributes IDictionary<string, object>? -
Data attribute Values
[data-side] "top" | "right" | "bottom" | "left"

The shared resizing container that hosts the active panel. Place it outside the List; open Content teleports into it. Renders a div.

Prop Type Default
ForceMount bool false
Data attribute Values
[data-orientation] "horizontal" | "vertical"

While open, the engine writes --navius-navigation-menu-viewport-width and --navius-navigation-menu-viewport-height (px) on the element so the container can animate to the active panel's size.

A nested submenu root, placed inside a Content panel. Owns its own open value and orientation. Renders a div.

Prop Type Default
Value string? -
ValueChanged EventCallback<string?> -
DefaultValue string? -
Orientation string "vertical"
OpenDelay int 200
CloseDelay int 300
ChildContent RenderFragment? -
Data attribute Values
[data-orientation] "horizontal" | "vertical"

Accessibility

Built as site navigation: the root is a <nav> landmark and the trigger row behaves as a single composite Tab stop with arrow-key roving, following the disclosure WAI-ARIA design pattern.

Key Description
Space When focus is on a trigger, toggles its content open or closed.
Enter When focus is on a trigger, toggles its content open or closed.
ArrowDown In horizontal orientation, opens the focused trigger's content and moves focus into it.
ArrowRight In vertical orientation, opens the focused trigger's content and moves focus into it. In horizontal orientation, moves to the next trigger.
ArrowLeft In horizontal orientation, moves focus to the previous trigger.
ArrowUp In vertical orientation, moves focus to the previous trigger.
Home Moves focus to the first trigger.
End Moves focus to the last trigger.
Esc Closes the open content and returns focus to its trigger.
Tab Moves focus into the content, then out of the menu.