Guides
Navigation
Feedback
Overlays
Layout
Data Display
Forms
.md

Navbar

navbar-04

Navbar with a mega menu laid out as a two-column grid of icon, title, and description items. Mobile menu uses an expandable sheet.

Open full screen →

Installation

php artisan ui:add-block navbar-04

A single command installs the block's Blade file and every component it depends on. Render it in your own layout as <x-ui.blocks.navbar-04 />.

Components it includes

Usage

Every piece of content is a prop, so you can drive this navbar from a CMS. A link is either a plain string or ['label' => ..., 'href' => ...]. A mega item is ['label' =>, 'description' =>, 'href' =>, 'icon' => '<svg ...>']; the grid is two columns, so an even count looks best. An action is ['label' =>, 'href' =>, 'variant' =>]; give it an href and it renders as a link, leave href out and it stays a plain button.

<x-ui.blocks.navbar-04
    brand="Acme"
    mega-label="Platform"
    :mega-items="[
        ['label' => 'Deployments', 'description' => 'Ship on every push.', 'href' => '/deploy', 'icon' => '<svg viewBox=\'0 0 24 24\'>...</svg>'],
        ['label' => 'Previews', 'description' => 'A URL per pull request.', 'href' => '/previews'],
        ['label' => 'Monitoring', 'description' => 'Know before your users do.', 'href' => '/monitoring'],
        ['label' => 'Rollbacks', 'description' => 'One click back to safety.', 'href' => '/rollbacks'],
    ]"
    :links="[
        ['label' => 'Pricing', 'href' => '/pricing'],
        ['label' => 'Docs', 'href' => '/docs'],
    ]"
    :actions="[
        ['label' => 'Sign in', 'href' => route('login'), 'variant' => 'ghost'],
        ['label' => 'Start free', 'href' => route('register'), 'variant' => 'default'],
    ]"
/>

Props

Every prop with its default. Pass any of them as attributes, using : to bind a PHP value.

@props([
    'brand' => 'LaralCN',
    'brandHref' => '#',
    'megaLabel' => 'Features',
    'megaItems' => null,
    'links' => ['Pricing', 'Docs'],
    'actions' => [
        ['label' => 'Sign in', 'href' => null, 'variant' => 'ghost'],
        ['label' => 'Get Started', 'href' => null, 'variant' => 'default'],
    ],
])