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

Navbar

The store's ready-made navbars: the ten presets work with every theme and take the colours, corners and font from the current theme.

zb:shop.site-header 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 Marketplace preset in full page

Choosing a preset

PHP

Pick one of the ten presets with the navbar setting; left empty, each theme draws its own navbar.

php
// config/zubazar-ui-pro.php (commerce)
'navbar' => env('SHOP_NAVBAR', 'marketplace'),
PropValues
marketplaceMarketplace
fashionVisual catalogue
electronicsStore
groceryGrocery
home-livingHome & living
beautyBeauty
automotiveAutomotive
wholesaleWholesale
boutiqueBoutique
servicesCorporate

Mega menu

PHP

The mega menu's departments, groups and links come from the store's categoryMenu() method.

php
public function categoryMenu(): array
{
    return [
        ['label' => 'Fashion', 'url' => route('web.categories.show', 'fashion'), 'icon' => 'shopping-bag', 'children' => [
            ['label' => 'Clothing', 'url' => '/category/fashion/clothing', 'children' => [
                ['label' => 'T-shirts', 'url' => '/category/fashion/t-shirts'],
                ['label' => 'Shirts', 'url' => '/category/fashion/shirts'],
            ]],
            ['label' => 'Shoes', 'url' => '/category/fashion/shoes', 'children' => [
                ['label' => 'Sneakers', 'url' => '/category/fashion/sneakers', 'image' => '/img/menu/sneakers.jpg'],
            ]],
        ]],
    ];
}
PropValues
label, url, iconA department: shown in the left list, its page opens on click
childrenGroups: a title (label, url) and links (children)
image | productThe link's picture or product (picture menus)

Developer notes

Events, hooks and details
  • The shared layout, and a layout of your own, draw the navbar with <zb:shop.site-header />.
  • The presets' parts: the utility strip, the logo, the search (with an optional Search button), the account and the cart (icons only, each icon above its name, or corporate: the account as the primary button), the category rail with its mega menu (words or round pictures) and, on phones, the drawer that steps into submenus.
  • On a phone every preset has its own layout: a search with a button, in a dark band, in a thick frame, rounded or opened by a magnifier; departments as chips or as round icons that scroll sideways.
  • In the corporate preset "Products" opens a full-width showcase: a search and "All products" at the top, the departments with their icons on the left, and each group as a heading over picture cards on the right. The other menu items with children open a panel of their own: links with icons in two columns on the left (icon, and a line under the name: description) and a feature card on the right (feature: title, text, cta, url and image or product).
  • The previews open in full width: the mega menu opens on hover, and the category rail hides while scrolling down and comes back on scrolling up.
  • The mega menu shows the departments on the left and their groups in up to four columns on the right; each group shows its first five links, and "Show more" opens the rest.
  • The mega menu's panel is always 32rem tall (it does not change with the department) and gets lower when the screen has less room; a long column scrolls on its own.
  • On phones the header links move under the drawer; with neither topLinks() nor freeShippingThreshold(), the utility strip is not drawn.
Zubazar UI · ZubazarDesigned for people.