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
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
Build the top menu in the nav slot with zb:nav.horizontal-item and zb:nav.horizontal-group.
<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>
| Prop | Values |
|---|---|
brand-name | Name next to the logo; defaults to config('app.name') |
home-url | Link of the logo; defaults to url('/') |
title | Tab title |
Top bar
To the right of the menu come, in order, search (only xl and up), actions, the light/dark button and userMenu.
<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>
| Prop | Values |
|---|---|
theme-toggle | true | false |
Preferences and the theme switcher
The mode, primary color, the bordered look and saving preferences work as in the vertical layout.
<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>
| Prop | Values |
|---|---|
mode | light | dark | system |
brand-color | default | green | red | yellow | blue | gray | dark | #rrggbb |
skin | default | bordered |
customizer | true | false |
Props
The values the component takes. What are props and slots?
| Prop | Type | Default | Description |
|---|---|---|---|
title | — | null | Tab 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 | — | null | Title of the mobile drawer; defaults to brand-name |
theme-toggle | boolean | true | The light/dark button in the top bar (zb:theme-switcher) |
mode | — | null | light · dark · system; when null, the preference in the browser |
theme | — | null | A color theme's key; when null, the current theme (the built-in light/dark) |
scope | — | null | The scope the choices are kept in, in the browser; when null, panel |
brand-color | — | null | default · green · red · yellow · blue · gray · dark · #rrggbb |
preference-url | — | null | URL that the appearance preferences are POSTed to |
skin | — | null | default · bordered |
content-width | — | null | default (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 |
customizer | boolean | false | The theme switcher panel on the right edge (without the menu options) |
stacked | boolean | false | The 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
- Below
lgthe menu moves into a drawer that opens from the left; the links inside groups arecompactsub-items. - Unlike the vertical layout, when the
logoslot is given, the brand name is not shown separately; pass the logo and the name together in the slot. - Without
mobileNav, the drawer rendersnav, but horizontal items do not look good in the drawer. - Set the drawer's title with
drawer-titleand its bottom withdrawerFooter. - To remove the light/dark button, pass
:theme-toggle="false". - Since the horizontal layout has no sidebar, there is no
sidebar-mode,navbar-modeorsemi-dark; thecustomizerpanel does not show the menu and top bar options either.