v0.0.2
Demos (demo panel, opens in a new tab)

Horizontal layout

A panel layout for applications with a short menu, with the menu laid out horizontally in the top bar.

zb:layout.horizontal zubazar/ui-pro

PRO

This component is in Zubazar UI Pro; Zubazar UI Pro brings Zubazar UI with it. Installing Zubazar UI Pro →

Open the horizontal layout as a full page

Basic usage

BLADE

Build the top menu in the nav slot with zb:nav.horizontal-item and zb:nav.horizontal-group.

blade
<zb:layout.horizontal :title="$title ?? null" brand-name="Zubazar Panel" :home-url="route('dashboard')">
    <zb:slot:head>@vite(['resources/css/app.css', 'resources/js/app.js'])</zb:slot:head>
    <zb:slot:nav>
        <zb:nav.horizontal-item :href="route('dashboard')" title="Home" :active="request()->routeIs('dashboard')" />
        <zb:nav.horizontal-group title="Customers" :active="request()->routeIs('customers.*')">
            <zb:nav.sub-item compact :href="route('customers.index')" title="Customer List" />
        </zb:nav.horizontal-group>
    </zb:slot:nav>
    {{ $slot }}
</zb:layout.horizontal>
PropValues
brand-nameName next to the logo; defaults to config('app.name')
home-urlLink of the logo; defaults to url('/')
titleTab title

Mobile menu

BLADE

To show vertical menu items (zb:nav.item, zb:nav.group) in the mobile drawer, use the mobileNav slot.

blade
<zb:layout.horizontal brand-name="Zubazar Panel" drawer-title="Menu">
    <zb:slot:nav>…</zb:slot:nav>

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

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

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

Top bar

BLADE

To the right of the menu come, in order, search (only xl and up), actions, the light/dark button and userMenu.

blade
<zb:layout.horizontal brand-name="Zubazar Panel">
    <zb:slot:nav>…</zb:slot:nav>

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

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

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

Preferences and the theme switcher

BLADE

The mode, primary color, the bordered look and saving preferences work as in the vertical layout.

blade
<zb:layout.horizontal
    brand-name="Zubazar Panel"
    :mode="auth()->user()?->theme_mode"
    :brand-color="auth()->user()?->brand_color"
    :preference-url="route('ui-preference.update')"
    skin="bordered"
    customizer
>
    {{ $slot }}
</zb:layout.horizontal>
PropValues
modelight | dark | system
brand-colordefault | green | red | yellow | blue | gray | dark | #rrggbb
skindefault | bordered
customizertrue | false

Props

The values the component takes. What are props and slots?

PropTypeDefaultDescription
title—nullTab title; defaults to the application name
brand-name—config('app.name')Brand name next to the logo (when there is no logo slot)
home-url—url('/')Link of the logo
drawer-title—nullTitle of the mobile drawer; defaults to brand-name
theme-togglebooleantrueThe light/dark button in the top bar (zb:theme-switcher)
mode—nulllight · dark · system; when null, the preference in the browser
theme—nullA color theme's key; when null, the current theme (the built-in light/dark)
scope—nullThe scope the choices are kept in, in the browser; when null, panel
brand-color—nulldefault · green · red · yellow · blue · gray · dark · #rrggbb
preference-url—nullURL that the appearance preferences are POSTed to
skin—nulldefault · bordered
content-width—nulldefault (1280px) · wide (1440px) · wider (1600px) · full · a CSS length (1520px); boxed is wide. The top bar, the page and the footer share one container; null: the browser's choice, then config, then full
customizerbooleanfalseThe theme switcher panel on the right edge (without the menu options)
stackedbooleanfalseThe 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 (a square mark, about 30 pixels), wordmark (next to the logo from sm up), nav, mobileNav, search, actions, userMenu, drawerFooter, default (page content)

Developer notes

Events, hooks and details
  • Below lg the menu moves into a drawer that opens from the left; 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.
  • Without mobileNav, the drawer renders nav, but horizontal items do not look good in the drawer.
  • Set the drawer's title with drawer-title and its bottom with drawerFooter.
  • To remove the light/dark button, pass :theme-toggle="false".
  • 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.
Zubazar UI · ZubazarDesigned for people.