EN
Getting started
05 · Layout

Horizontal layout

A panel layout with a top menu. On wide screens the menu sits horizontally in the top bar; below lg it moves into a drawer that opens from the left. It is an alternative to the vertical layout for applications with a short menu.

acun:layout.horizontal
01

Basic usage

Build the top menu in the nav slot with acun:nav.horizontal-item and acun:nav.horizontal-group; the links inside groups are compact sub-items. Unlike the vertical layout, when the logo slot is given, the brand name is not shown separately; pass the logo and the name together in the slot.

BLADE
<acun:layout.horizontal :title="$title ?? null" brand-name="Acun Panel" :home-url="route('dashboard')">
    <acun:slot:head>
        @vite(['resources/css/app.css', 'resources/js/app.js'])
    </acun:slot:head>

    <acun:slot:nav>
        <acun:nav.horizontal-item :href="route('dashboard')" title="Home" :active="request()->routeIs('dashboard')" />
        <acun:nav.horizontal-group title="Customers" :active="request()->routeIs('customers.*')">
            <acun:nav.sub-item compact :href="route('customers.index')" title="Customer List" />
            <acun:nav.sub-item compact :href="route('customer-groups.index')" title="Customer Groups" />
        </acun:nav.horizontal-group>
    </acun:slot:nav>

    {{ $slot }}
</acun:layout.horizontal>
PropValues
brand-nameName next to the logo; defaults to config('app.name')
home-urlLink of the logo; defaults to url('/')
titleTab title
02

Mobile menu

Below lg the horizontal menu is hidden and the menu button opens a drawer from the left. The drawer renders the mobileNav slot, or nav when that is not given; since horizontal items do not look good in the drawer, pass vertical menu items (acun:nav.item, acun:nav.group) here. The drawer title is set with drawer-title and its bottom with drawerFooter.

BLADE
<acun:layout.horizontal brand-name="Acun Panel" drawer-title="Menu">
    <acun:slot:nav>…</acun:slot:nav>

    <acun:slot:mobileNav>
        <acun:nav.item :href="route('dashboard')" title="Home" />
        <acun:nav.group title="Customers">
            <acun:nav.sub-item :href="route('customers.index')" title="Customer List" />
            <acun:nav.sub-item :href="route('customer-groups.index')" title="Customer Groups" />
        </acun:nav.group>
    </acun:slot:mobileNav>

    <acun:slot:drawerFooter>
        <form method="POST" action="{{ route('logout') }}">
            @csrf
            <acun:button type="submit" variant="ghost" class="w-full">Log Out</acun:button>
        </form>
    </acun:slot:drawerFooter>

    {{ $slot }}
</acun:layout.horizontal>
PropValues
drawer-titleTitle of the drawer; defaults to brand-name
03

Top bar

To the right of the menu come, in order, search (only xl and up), actions, the theme toggle and userMenu. To remove the theme toggle, pass :theme-toggle="false".

BLADE
<acun:layout.horizontal brand-name="Acun Panel">
    <acun:slot:nav>…</acun:slot:nav>

    <acun:slot:search>
        <acun:command-palette :items="$searchItems" />
    </acun:slot:search>

    <acun:slot:userMenu>
        <acun:user-menu :name="auth()->user()->name">
            <acun:dropdown.item :href="route('profile.edit')" wire:navigate>Settings</acun:dropdown.item>
        </acun:user-menu>
    </acun:slot:userMenu>

    {{ $slot }}
</acun:layout.horizontal>
PropValues
theme-toggletrue | false
04

Preferences and customizer

Theme, primary color, the bordered look and saving preferences work as in the vertical layout. Since the horizontal layout has no sidebar, there is no sidebar-mode, navbar-mode or semi-dark; the customizer panel does not show the menu and top bar options either.

BLADE
<acun:layout.horizontal
    brand-name="Acun Panel"
    :theme="auth()->user()?->theme_preference"
    :brand-color="auth()->user()?->brand_color"
    :preference-url="route('ui-preference.update')"
    skin="bordered"
    customizer
>
    {{ $slot }}
</acun:layout.horizontal>
PropValues
themelight | dark | system
brand-colordefault | green | red | yellow | blue | gray | dark | #rrggbb
skindefault | bordered
customizertrue | false
API

Props and slots

The values the component accepts.

PropDefaultDescription
titlenullTab title; defaults to the application name
brand-nameconfig('app.name')Brand name next to the logo (when there is no logo slot)
home-urlurl('/')Link of the logo
drawer-titlenullTitle of the mobile drawer; defaults to brand-name
theme-toggletrueTheme toggle in the top bar
themenulllight · dark · system; when null, the preference in the browser
brand-colornulldefault · green · red · yellow · blue · gray · dark · #rrggbb
preference-urlnullURL that the appearance preferences are POSTed to
skinnulldefault · bordered
customizerfalseAppearance customizer on the right edge (without the menu options)
stackedfalseThe menu sits on its own row below the logo, search and user menu; for long menus that do not fit on one row
Slots: head, logo, nav, mobileNav, search, actions, userMenu, drawerFooter, default (page content)
Acun UI · Horizontal layoutDetailed usage and examples