Menus & navigation JS behaviour

Mega menu

A big header menu with columns and per-item descriptions; moving between triggers slides the new panel in from the side you came from.

Real scenarios

The component as it is used in a product — not a specimen grid.

A product header

Hover or keyboard into “Product” and “Resources”; the panel glides in from the side you arrived from. Arrow-down opens from the keyboard, and the underline follows the focused link.

The page body flows under the open panel — try moving the pointer straight from “Product” to “Resources” to see the slide.

Important props

Important props
Prop Type Default What it does
items array [] A plain item: label + href (+ current); a panel item: children with label, href, icon and description, plus columns.
label string null The nav element’s accessible label.
navigate bool false Links navigate through wire:navigate.

Snippet

<x-nx::mega-menu label="راهبری اصلی" :items="[
    ['label' => 'محصول', 'columns' => 3, 'children' => [
        ['label' => 'مانیتورینگ', 'icon' => 'chart', 'href' => '/components', 'description' => 'متریک‌های زندهٔ سرویس‌ها'],
        ['label' => 'هشدارها', 'icon' => 'bell', 'href' => '/components', 'description' => 'قواعد و канал‌های اطلاع'],
    ]],
    ['label' => 'قیمت‌گذاری', 'href' => '/components', 'current' => true],
]" />