Skip to content
Brok UI

Loading…

No results

Store Navbar

Open source

Storefront navigation bars — utility strip, category links, search and wishlist/account/cart actions with a cart count.

Preview

resources/views/blocks/store-navbar-minimal.blade.php Blade
@props([
    'brand'       => 'Maison',
    'brandHref'   => '/',
    'links'       => null,
    'cartCount'   => 0,
    'cartHref'    => '/cart',
    'accountHref' => '/account',
    'searchHref'  => '/search',
])

@php
    $links ??= [
        ['label' => 'New Arrivals', 'href' => '/new'],
        ['label' => 'Women', 'href' => '/women'],
        ['label' => 'Men', 'href' => '/men'],
        ['label' => 'Accessories', 'href' => '/accessories'],
        ['label' => 'Sale', 'href' => '/sale'],
    ];
@endphp

<nav aria-label="{{ __('Store') }}" data-slot="store-navbar" {{ $attributes->merge(['class' => 'border-b border-border bg-background']) }}>
    <div class="mx-auto max-w-7xl px-4">
        <div class="relative flex h-16 items-center justify-between">
            <div class="flex items-center sm:hidden">
                <x-ui.button variant="ghost" size="icon" aria-label="{{ __('Open menu') }}">
                    <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" class="size-5" aria-hidden="true"><line x1="3" y1="6" x2="21" y2="6" /><line x1="3" y1="12" x2="21" y2="12" /><line x1="3" y1="18" x2="21" y2="18" /></svg>
                </x-ui.button>
            </div>

            <div class="pointer-events-none absolute inset-x-0 flex justify-center">
                <a href="{{ $brandHref }}" class="pointer-events-auto text-lg font-bold tracking-tight text-foreground transition-colors hover:text-foreground/70" aria-label="{{ __(':brand home', ['brand' => $brand]) }}">{{ $brand }}</a>
            </div>

            <div class="ms-auto flex items-center gap-2">
                <x-ui.button variant="ghost" size="icon" :href="$searchHref" aria-label="{{ __('Search') }}">
                    <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" class="size-5" aria-hidden="true"><circle cx="11" cy="11" r="7" /><line x1="16.5" y1="16.5" x2="22" y2="22" /></svg>
                </x-ui.button>
                <x-ui.button variant="ghost" size="icon" :href="$accountHref" aria-label="{{ __('Account') }}">
                    <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" class="size-5" aria-hidden="true"><circle cx="12" cy="8" r="4" /><path d="M4 20c0-4 3.582-7 8-7s8 3 8 7" /></svg>
                </x-ui.button>
                <x-ui.notification-badge :count="$cartCount">
                    <x-ui.button variant="ghost" size="icon" :href="$cartHref" aria-label="{{ __('Cart, :count items', ['count' => $cartCount]) }}">
                        <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" class="size-5" aria-hidden="true"><path d="M6 2L3 6v14a2 2 0 002 2h14a2 2 0 002-2V6l-3-4z" /><line x1="3" y1="6" x2="21" y2="6" /><path d="M16 10a4 4 0 01-8 0" /></svg>
                    </x-ui.button>
                </x-ui.notification-badge>
            </div>
        </div>
    </div>

    <div class="hidden border-t border-border sm:block">
        <div class="mx-auto max-w-7xl px-4">
            <div class="flex h-10 items-center justify-center gap-6">
                @foreach ($links as $link)
                    <a href="{{ $link['href'] }}" class="text-sm font-medium text-muted-foreground transition-colors hover:text-foreground">{{ __($link['label']) }}</a>
                @endforeach
            </div>
        </div>
    </div>
</nav>

Installation

terminal
php artisan ui:add blocks/store-navbar-minimal

Installs these dependencies automatically:

Registry contract

Install confidence

php artisan ui:add blocks/store-navbar-minimal writes only the generated targets below. The CLI validates each file hash before writing and prompts before replacing local changes unless --force is used.

Version
1.1.1
License
open
Stability
stable
Contract
v1
Foundation
≥ 1.0.0
Type Generated target
blade resources/views/blocks/store-navbar-minimal.blade.php

Registry dependencies

button notification-badge

Package dependencies

composer: jml/brok:^0.2

Use with AI

A brief for your coding agent: what the block is, the install command, how to render it, its props and the rules. Copy it, or open a prompt about this block in an assistant.

store-navbar-minimal.md
# Brok UI block: Store Navbar Minimal (`store-navbar-minimal`)

A minimal store navbar with a centered wordmark, icon-only search, account and cart actions, and a centered category-link row beneath.

Brok UI is a Laravel Blade registry. `ui:add` copies this block into the app as plain Blade the app owns; it composes installed `<brok:*>` primitives and semantic design tokens.

## Install

```bash
php artisan ui:add blocks/store-navbar-minimal
```

## Render it

```blade
<x-blocks.store-navbar-minimal />
```

## Props

- `brand` (string, default `Maison`) — Brand wordmark text.
- `brand-href` (string, default `/`) — Destination for the brand wordmark link.
- `links` (mixed|null, default `null`) — Category links shown in the mobile menu; null falls back to sample data.
- `cart-count` (int, default `0`) — Number shown on the cart badge.
- `cart-href` (string, default `/cart`) — Cart destination.
- `account-href` (string, default `/account`) — Account destination.
- `search-href` (string, default `/search`) — Search destination.

## Use when

- Building a minimal storefront navbar with a centered wordmark and icon-only actions.
- Wanting fewer visible links for boutique or minimalist brands.

## Avoid when

- Needing category links or a mega-menu visible in the bar; use store-navbar-mega or store-navbar-default instead.

## Rules

- Render the installed block with `<x-blocks.store-navbar-minimal />` and pass data through its props; edit the copied file only for structural changes.
- Keep the semantic design tokens (`bg-background`, `text-muted-foreground`); never swap in raw colour utilities.
- Keep the `data-slot` attributes and the logical (start/end) spacing so the markup still mirrors under `dir="rtl"`.

## Links

- Docs: https://brokui.dev/blocks/store-navbar-minimal
- Registry JSON (files, props, contract): https://brokui.dev/r/open/blocks/store-navbar-minimal.json

Working in Claude Code, Cursor or Codex? Give the agent the whole registry through the MCP server or the Brok UI skill.

Guidance

Use when

  • Building a minimal storefront navbar with a centered wordmark and icon-only actions.
  • Wanting fewer visible links for boutique or minimalist brands.

Avoid when

  • Needing category links or a mega-menu visible in the bar; use store-navbar-mega or store-navbar-default instead.

Anti-patterns

  • Do not replace semantic props with conflicting utility classes.
  • Do not remove labels, focus styles, or state attributes.
Anatomy
root store-navbar

Usage

Render the block as a component, passing data where useful:

resources/views/welcome.blade.php Blade
<x-blocks.store-navbar-minimal />

Built from primitives

Composes <brok:*> Semantic tokens Re-themeable RTL-ready

This block composes installed <brok:*> primitives and semantic design tokens only — it does not reimplement any primitive. Re-theme it (light, dark, admin, customer) by editing CSS variables; flip the preview to RTL to confirm it mirrors.

Source

The exact, editable file ui:add writes into your app. The preview above renders this same source — there are no preview-only blocks.

resources/views/blocks/store-navbar-minimal.blade.php Blade
@props([
    'brand'       => 'Maison',
    'brandHref'   => '/',
    'links'       => null,
    'cartCount'   => 0,
    'cartHref'    => '/cart',
    'accountHref' => '/account',
    'searchHref'  => '/search',
])

@php
    $links ??= [
        ['label' => 'New Arrivals', 'href' => '/new'],
        ['label' => 'Women', 'href' => '/women'],
        ['label' => 'Men', 'href' => '/men'],
        ['label' => 'Accessories', 'href' => '/accessories'],
        ['label' => 'Sale', 'href' => '/sale'],
    ];
@endphp

<nav aria-label="{{ __('Store') }}" data-slot="store-navbar" {{ $attributes->merge(['class' => 'border-b border-border bg-background']) }}>
    <div class="mx-auto max-w-7xl px-4">
        <div class="relative flex h-16 items-center justify-between">
            <div class="flex items-center sm:hidden">
                <x-ui.button variant="ghost" size="icon" aria-label="{{ __('Open menu') }}">
                    <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" class="size-5" aria-hidden="true"><line x1="3" y1="6" x2="21" y2="6" /><line x1="3" y1="12" x2="21" y2="12" /><line x1="3" y1="18" x2="21" y2="18" /></svg>
                </x-ui.button>
            </div>

            <div class="pointer-events-none absolute inset-x-0 flex justify-center">
                <a href="{{ $brandHref }}" class="pointer-events-auto text-lg font-bold tracking-tight text-foreground transition-colors hover:text-foreground/70" aria-label="{{ __(':brand home', ['brand' => $brand]) }}">{{ $brand }}</a>
            </div>

            <div class="ms-auto flex items-center gap-2">
                <x-ui.button variant="ghost" size="icon" :href="$searchHref" aria-label="{{ __('Search') }}">
                    <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" class="size-5" aria-hidden="true"><circle cx="11" cy="11" r="7" /><line x1="16.5" y1="16.5" x2="22" y2="22" /></svg>
                </x-ui.button>
                <x-ui.button variant="ghost" size="icon" :href="$accountHref" aria-label="{{ __('Account') }}">
                    <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" class="size-5" aria-hidden="true"><circle cx="12" cy="8" r="4" /><path d="M4 20c0-4 3.582-7 8-7s8 3 8 7" /></svg>
                </x-ui.button>
                <x-ui.notification-badge :count="$cartCount">
                    <x-ui.button variant="ghost" size="icon" :href="$cartHref" aria-label="{{ __('Cart, :count items', ['count' => $cartCount]) }}">
                        <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" class="size-5" aria-hidden="true"><path d="M6 2L3 6v14a2 2 0 002 2h14a2 2 0 002-2V6l-3-4z" /><line x1="3" y1="6" x2="21" y2="6" /><path d="M16 10a4 4 0 01-8 0" /></svg>
                    </x-ui.button>
                </x-ui.notification-badge>
            </div>
        </div>
    </div>

    <div class="hidden border-t border-border sm:block">
        <div class="mx-auto max-w-7xl px-4">
            <div class="flex h-10 items-center justify-center gap-6">
                @foreach ($links as $link)
                    <a href="{{ $link['href'] }}" class="text-sm font-medium text-muted-foreground transition-colors hover:text-foreground">{{ __($link['label']) }}</a>
                @endforeach
            </div>
        </div>
    </div>
</nav>

Ownership & lifecycle

Owner, release state, review evidence and adoption for this item.
Owner
Platform UI (@JoshJML)
Current version
1.1.1
Status
Stable
License
open
Deprecation
Not deprecated
Contract
v1
Foundation
≥ 1.0.0