Guides
Navigation
Feedback
Overlays
Layout
Data Display
Forms
.md

Navbar

navbar-02

Minimal top navbar with centered links, a dropdown, and a single primary action. Collapses into a slide-in sheet on mobile.

Open full screen →

Installation

php artisan ui:add-block navbar-02

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

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' => ...]. 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. Variants are default, outline, secondary, ghost, link and destructive. Pass :menu-label="null" to drop the dropdown entirely.

<x-ui.blocks.navbar-02
    brand="Acme"
    brand-href="/"
    :links="[
        ['label' => 'Product', 'href' => '/product'],
        ['label' => 'Pricing', 'href' => '/pricing'],
        'Customers',
    ]"
    menu-label="Resources"
    :menu-links="[
        ['label' => 'Docs', 'href' => '/docs'],
        ['label' => 'Changelog', 'href' => '/changelog'],
    ]"
    :actions="[
        ['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', 'Link Two', 'Link Three'],
    'menuLabel' => 'Link Four',
    'menuLinks' => ['Link Five', 'Link Six', 'Link Seven'],
    'actions' => [['label' => 'Get Started', 'href' => null, 'variant' => 'default']],
])