Skip to content
Brok UI

Loading…

No results

App Header

Open source

In-app structural headers and footers — page and section headers, a searchable resource toolbar, and a form action footer.

Preview

1 of 5

resources/views/blocks/app-header-page.blade.php Blade
@props([
    'title'       => 'Acme Marketing Site',
    'description' => 'Manage your project settings, members, and activity.',
    'status'      => 'Active',
    'breadcrumbs' => null,
    'tabs'        => null,
])

@php
    $breadcrumbs ??= [
        ['label' => 'Dashboard', 'href' => '#'],
        ['label' => 'Projects', 'href' => '#'],
    ];

    $tabs ??= [
        ['label' => 'Overview', 'href' => '#', 'active' => true],
        ['label' => 'Activity', 'href' => '#', 'active' => false],
        ['label' => 'Settings', 'href' => '#', 'active' => false],
        ['label' => 'Members', 'href' => '#', 'active' => false],
    ];
@endphp

<header {{ $attributes->merge(['class' => 'border-b border-border bg-background']) }}>
    <div class="mx-auto max-w-7xl px-4 py-6">
        <x-ui.breadcrumb>
            <x-ui.breadcrumb.list>
                @foreach ($breadcrumbs as $crumb)
                    <x-ui.breadcrumb.item>
                        <x-ui.breadcrumb.link :href="$crumb['href']">{{ __($crumb['label']) }}</x-ui.breadcrumb.link>
                    </x-ui.breadcrumb.item>
                    <x-ui.breadcrumb.separator />
                @endforeach
                <x-ui.breadcrumb.item>
                    <x-ui.breadcrumb.page>{{ __($title) }}</x-ui.breadcrumb.page>
                </x-ui.breadcrumb.item>
            </x-ui.breadcrumb.list>
        </x-ui.breadcrumb>

        <div class="mt-4 flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between">
            <div class="flex flex-col gap-2">
                <div class="flex flex-wrap items-center gap-2">
                    <h1 class="text-2xl font-bold text-foreground">{{ __($title) }}</h1>
                    @if ($status)
                        <x-ui.badge variant="success">{{ __($status) }}</x-ui.badge>
                    @endif
                </div>
                @if ($description)
                    <p class="text-sm text-muted-foreground">{{ __($description) }}</p>
                @endif
            </div>

            <div class="flex shrink-0 items-center gap-2">
                <x-ui.button variant="ghost">
                    <x-slot:icon>
                        <svg class="size-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
                            <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" /><polyline points="7 10 12 15 17 10" /><line x1="12" y1="15" x2="12" y2="3" />
                        </svg>
                    </x-slot:icon>
                    {{ __('Export') }}
                </x-ui.button>

                <x-ui.button variant="default">
                    <x-slot:icon>
                        <svg class="size-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
                            <line x1="12" y1="5" x2="12" y2="19" /><line x1="5" y1="12" x2="19" y2="12" />
                        </svg>
                    </x-slot:icon>
                    {{ __('New project') }}
                </x-ui.button>
            </div>
        </div>

        <nav class="-mb-px mt-6 flex gap-6 overflow-x-auto border-b border-border" aria-label="{{ __('Tabs') }}">
            @foreach ($tabs as $tab)
                <a
                    href="{{ $tab['href'] }}"
                    @class([
                        'whitespace-nowrap pb-4 text-sm transition-colors motion-reduce:transition-none',
                        'border-b-2 border-primary font-medium text-foreground' => $tab['active'] ?? false,
                        'border-b-2 border-transparent text-muted-foreground hover:text-foreground' => ! ($tab['active'] ?? false),
                    ])
                    @if ($tab['active'] ?? false) aria-current="page" @endif
                >{{ __($tab['label']) }}</a>
            @endforeach
        </nav>
    </div>
</header>

Installation

terminal
php artisan ui:add blocks/app-header-page

Installs these dependencies automatically:

Registry contract

Install confidence

php artisan ui:add blocks/app-header-page 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.0.3
License
open
Stability
stable
Contract
v1
Foundation
≥ 1.0.0
Type Generated target
blade resources/views/blocks/app-header-page.blade.php

Registry dependencies

breadcrumb button 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.

app-header-page.md
# Brok UI block: Page Header (`app-header-page`)

An application page header with a breadcrumb trail, a title and status badge, export and new-project actions, and an underlined tab navigation row.

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/app-header-page
```

## Render it

```blade
<x-blocks.app-header-page />
```

## Props

- `title` (string, default `Acme Marketing Site`)
- `description` (string, default `Manage your project settings, members, and activity.`)
- `status` (string, default `Active`)
- `breadcrumbs` (mixed|null, default `null`)
- `tabs` (mixed|null, default `null`)

## Use when

- Heading an application page with a breadcrumb trail, a title with a status badge, and export or new-item actions.
- Adding an underlined tab-navigation row beneath the title to switch between page sections.

## Avoid when

- Use app-header-section for a compact section header without breadcrumbs, or app-header-page-stats for a header with inline KPI stats.

## Rules

- Render the installed block with `<x-blocks.app-header-page />` 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/app-header-page
- Registry JSON (files, props, contract): https://brokui.dev/r/open/blocks/app-header-page.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

  • Heading an application page with a breadcrumb trail, a title with a status badge, and export or new-item actions.
  • Adding an underlined tab-navigation row beneath the title to switch between page sections.

Avoid when

  • Use app-header-section for a compact section header without breadcrumbs, or app-header-page-stats for a header with inline KPI stats.

Anti-patterns

  • Do not replace semantic props with conflicting utility classes.
  • Do not remove labels, focus styles, or state attributes.

Usage

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

resources/views/welcome.blade.php Blade
<x-blocks.app-header-page />

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/app-header-page.blade.php Blade
@props([
    'title'       => 'Acme Marketing Site',
    'description' => 'Manage your project settings, members, and activity.',
    'status'      => 'Active',
    'breadcrumbs' => null,
    'tabs'        => null,
])

@php
    $breadcrumbs ??= [
        ['label' => 'Dashboard', 'href' => '#'],
        ['label' => 'Projects', 'href' => '#'],
    ];

    $tabs ??= [
        ['label' => 'Overview', 'href' => '#', 'active' => true],
        ['label' => 'Activity', 'href' => '#', 'active' => false],
        ['label' => 'Settings', 'href' => '#', 'active' => false],
        ['label' => 'Members', 'href' => '#', 'active' => false],
    ];
@endphp

<header {{ $attributes->merge(['class' => 'border-b border-border bg-background']) }}>
    <div class="mx-auto max-w-7xl px-4 py-6">
        <x-ui.breadcrumb>
            <x-ui.breadcrumb.list>
                @foreach ($breadcrumbs as $crumb)
                    <x-ui.breadcrumb.item>
                        <x-ui.breadcrumb.link :href="$crumb['href']">{{ __($crumb['label']) }}</x-ui.breadcrumb.link>
                    </x-ui.breadcrumb.item>
                    <x-ui.breadcrumb.separator />
                @endforeach
                <x-ui.breadcrumb.item>
                    <x-ui.breadcrumb.page>{{ __($title) }}</x-ui.breadcrumb.page>
                </x-ui.breadcrumb.item>
            </x-ui.breadcrumb.list>
        </x-ui.breadcrumb>

        <div class="mt-4 flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between">
            <div class="flex flex-col gap-2">
                <div class="flex flex-wrap items-center gap-2">
                    <h1 class="text-2xl font-bold text-foreground">{{ __($title) }}</h1>
                    @if ($status)
                        <x-ui.badge variant="success">{{ __($status) }}</x-ui.badge>
                    @endif
                </div>
                @if ($description)
                    <p class="text-sm text-muted-foreground">{{ __($description) }}</p>
                @endif
            </div>

            <div class="flex shrink-0 items-center gap-2">
                <x-ui.button variant="ghost">
                    <x-slot:icon>
                        <svg class="size-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
                            <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" /><polyline points="7 10 12 15 17 10" /><line x1="12" y1="15" x2="12" y2="3" />
                        </svg>
                    </x-slot:icon>
                    {{ __('Export') }}
                </x-ui.button>

                <x-ui.button variant="default">
                    <x-slot:icon>
                        <svg class="size-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
                            <line x1="12" y1="5" x2="12" y2="19" /><line x1="5" y1="12" x2="19" y2="12" />
                        </svg>
                    </x-slot:icon>
                    {{ __('New project') }}
                </x-ui.button>
            </div>
        </div>

        <nav class="-mb-px mt-6 flex gap-6 overflow-x-auto border-b border-border" aria-label="{{ __('Tabs') }}">
            @foreach ($tabs as $tab)
                <a
                    href="{{ $tab['href'] }}"
                    @class([
                        'whitespace-nowrap pb-4 text-sm transition-colors motion-reduce:transition-none',
                        'border-b-2 border-primary font-medium text-foreground' => $tab['active'] ?? false,
                        'border-b-2 border-transparent text-muted-foreground hover:text-foreground' => ! ($tab['active'] ?? false),
                    ])
                    @if ($tab['active'] ?? false) aria-current="page" @endif
                >{{ __($tab['label']) }}</a>
            @endforeach
        </nav>
    </div>
</header>

Ownership & lifecycle

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