Set Up a Navigation Menu
Build a navigation menu with the Kompass Menu Builder and render it in your Blade templates via a Livewire component.
Step 1: Create a New Menu
- Log in to the Admin Dashboard.
- Navigate to Tools > Menu Builder.
- Click "New Menu".
- Enter a Name (e.g.,
Header Menu). The Slug (e.g.,header-menu) is what you'll reference in your code. - Click Save.
Step 2: Build the Menu Structure
- Click the "Builder" button next to your menu.
- Add items by providing a Name and a URL (or internal route).
- Organize by Drag & Drop:
- Move items up or down to change their order.
- Indent items to the right to create sub-menus (dropdowns).
- Click Save Changes.
Step 3: Render the Menu in Blade
Use the Kompass Livewire component in your layout file to output the menu.
blade
{{-- In your resources/views/layouts/app.blade.php --}}
<nav>
<livewire:menus name="header-menu" />
</nav>Customizing the Menu Output
The default component renders a clean list using the <x-kompass::menus> Blade component, which handles both simple and nested items with dropdown support automatically.