Navigation Components

Navigation components provide consistent navigation patterns throughout the application.

App Navigation

The <x-app-nav> component is the main application navigation bar.

Features

Structure

<x-app-nav />

The component includes:

The <x-nav-link> component creates navigation links with active states.

Props

Prop Type Required Description
href string Yes Link URL
active boolean No Whether link is active

Usage

<x-nav-link href="{{ route('items.index') }}" :active="request()->routeIs('items.*')">
    Items
</x-nav-link>

For mobile navigation menus:

<x-responsive-nav-link href="{{ route('items.index') }}" :active="request()->routeIs('items.*')">
    Items
</x-responsive-nav-link>

Dropdown menus use Alpine.js for interactivity:

<div x-data="{ openMenu: null }">
    <!-- Trigger -->
    <button @click="openMenu = openMenu === 'reference' ? null : 'reference'">
        Reference Data
    </button>

    <!-- Dropdown Menu -->
    <div x-show="openMenu === 'reference'"
         x-transition
         x-cloak
         @click.outside="openMenu = null"
         class="absolute mt-2 w-56 rounded-md bg-white shadow-lg">
        <a href="{{ route('countries.index') }}">Countries</a>
        <a href="{{ route('languages.index') }}">Languages</a>
    </div>
</div>

The <x-dropdown-link> component creates dropdown menu items:

<x-dropdown-link href="{{ route('profile.show') }}">
    Profile
</x-dropdown-link>

Breadcrumbs are rendered in the default layout:

<nav class="text-sm text-gray-600 mb-6">
    <a href="{{ '/api/' | relative_url }}">API Documentation</a>
    &nbsp;&#124;&nbsp;
    <a href="{{ '/models/' | relative_url }}">Database Models</a>
    <!-- ... more breadcrumb links -->
</nav>