Horizontal navigation menu component designed for AppBars and landing pages. Supports simple items, dropdown submenus, and customizable megamenus with rich content.
Prop | Type | Default |
|---|---|---|
No dataThere are no records to display | ||
Each item in the items array should follow this structure:
Prop | Type | Default |
|---|---|---|
No dataThere are no records to display | ||
Each subitem in the subitems array should follow this structure:
Prop | Type | Default |
|---|---|---|
No dataThere are no records to display | ||
Megamenus use Svelte snippets for completely custom content. Define your snippet and pass it to the menu item:
{#snippet megamenuContent()}
<div class="grid grid-cols-3 gap-6 p-4">
<div>
<div class="navmenu-header">Documentation</div>
<div class="flex flex-col gap-1">
<a href="/docs" class="navmenu-submenu-item">
<div class="navmenu-submenu-content">
<div class="navmenu-submenu-label">Getting Started</div>
<div class="navmenu-submenu-description">Quick start</div>
</div>
</a>
</div>
</div>
<!-- More columns -->
</div>
{/snippet}
const items = [
{
label: 'Resources',
type: 'megamenu',
megamenu: megamenuContent // Pass the snippet reference
}
]; .navmenu-header - Section header styling.navmenu-submenu-item - Individual menu item.navmenu-submenu-content - Content wrapper.navmenu-submenu-label - Item label.navmenu-submenu-description - Item description.navmenu-divider - Horizontal divider