Guides
Navigation
Feedback
Overlays
Layout
Data Display
Forms
.md

Navbar

navbar-05

Compact navbar with a two-group mega menu and a footer call-to-action row inside the panel. Mobile menu uses an expandable sheet.

Open full screen →

Installation

php artisan ui:add-block navbar-05

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-05 />.

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' => ...]; `links` sit before the mega-menu trigger and `linksAfter` sit after it. A mega group is ['title' =>, 'items' => [...]] and each item is ['label' =>, 'description' =>, 'href' =>, 'icon' => '<svg ...>']. 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. Pass :cta-label="null" to drop the footer row inside the panel.

<x-ui.blocks.navbar-05
    brand="Acme"
    :links="[['label' => 'Product', 'href' => '/product']]"
    mega-label="Platform"
    :mega-groups="[
        ['title' => 'Build', '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'],
        ]],
        ['title' => 'Operate', 'items' => [
            ['label' => 'Monitoring', 'description' => 'Know before your users do.', 'href' => '/monitoring'],
            ['label' => 'Rollbacks', 'description' => 'One click back to safety.', 'href' => '/rollbacks'],
        ]],
    ]"
    :links-after="[
        ['label' => 'Pricing', 'href' => '/pricing'],
        ['label' => 'Docs', 'href' => '/docs'],
    ]"
    cta-text="Not sure which plan fits?"
    cta-label="Talk to sales"
    cta-href="/contact"
    :actions="[
        ['label' => 'Sign in', 'href' => route('login'), 'variant' => 'outline'],
        ['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' => '#',
    'links' => ['Link One'],
    'megaLabel' => 'Link Two',
    'megaGroups' => null,
    'linksAfter' => ['Link Three', 'Link Four'],
    'ctaText' => 'Not sure where to start?',
    'ctaLabel' => 'Contact sales',
    'ctaHref' => '#',
    'actions' => [
        ['label' => 'Sign in', 'href' => null, 'variant' => 'outline'],
        ['label' => 'Get Started', 'href' => null, 'variant' => 'default'],
    ],
])