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

2 of 5

resources/views/blocks/app-header-section.blade.php Blade
@props([
    'title'       => 'Team members',
    'description' => 'Manage and review the members of your organisation.',
    'count'       => '24',
    'filterLabel' => 'Filter',
    'addLabel'    => 'Add member',
])

<header {{ $attributes->merge(['class' => 'bg-background']) }}>
    <div class="mx-auto max-w-5xl px-4">
        <div class="flex flex-col gap-4 border-b border-border pb-4 sm:flex-row sm:items-center sm:justify-between">
            <div class="min-w-0 flex-1">
                <div class="flex items-center gap-2">
                    <h2 class="truncate text-lg font-semibold text-foreground">{{ __($title) }}</h2>
                    @if ($count !== null && $count !== '')
                        <x-ui.badge variant="secondary" size="sm">{{ $count }}</x-ui.badge>
                    @endif
                </div>
                @if ($description)
                    <p class="mt-0.5 text-sm text-muted-foreground">{{ __($description) }}</p>
                @endif
            </div>

            <div class="flex shrink-0 items-center gap-2">
                <x-ui.button variant="ghost" size="sm">
                    <x-slot:icon>
                        <svg class="size-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
                            <path d="M3 4h18M7 10h10M11 16h2" />
                        </svg>
                    </x-slot:icon>
                    {{ __($filterLabel) }}
                </x-ui.button>

                <x-ui.button variant="default" size="sm">
                    <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="M12 5v14M5 12h14" />
                        </svg>
                    </x-slot:icon>
                    {{ __($addLabel) }}
                </x-ui.button>
            </div>
        </div>
    </div>
</header>

Installation

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

Installs these dependencies automatically:

Registry contract

Install confidence

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

Registry dependencies

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-section.md
# Brok UI block: Section Header (`app-header-section`)

A compact application section header: a title with an optional count badge and description beside filter and add actions, divided from the content below.

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-section
```

## Render it

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

## Props

- `title` (string, default `Team members`)
- `description` (string, default `Manage and review the members of your organisation.`)
- `count` (string, default `24`)
- `filter-label` (string, default `Filter`)
- `add-label` (string, default `Add member`)

## Use when

- Heading a section or list with a title, an optional count badge and a short description beside filter and add actions.
- Dividing the header from the content below with a bottom border rather than a full breadcrumb trail.

## Avoid when

- Use app-header-page for a full page header with breadcrumbs and tabs; app-header-section is for a smaller in-page section.

## Rules

- Render the installed block with `<x-blocks.app-header-section />` 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-section
- Registry JSON (files, props, contract): https://brokui.dev/r/open/blocks/app-header-section.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 a section or list with a title, an optional count badge and a short description beside filter and add actions.
  • Dividing the header from the content below with a bottom border rather than a full breadcrumb trail.

Avoid when

  • Use app-header-page for a full page header with breadcrumbs and tabs; app-header-section is for a smaller in-page section.

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-section />

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-section.blade.php Blade
@props([
    'title'       => 'Team members',
    'description' => 'Manage and review the members of your organisation.',
    'count'       => '24',
    'filterLabel' => 'Filter',
    'addLabel'    => 'Add member',
])

<header {{ $attributes->merge(['class' => 'bg-background']) }}>
    <div class="mx-auto max-w-5xl px-4">
        <div class="flex flex-col gap-4 border-b border-border pb-4 sm:flex-row sm:items-center sm:justify-between">
            <div class="min-w-0 flex-1">
                <div class="flex items-center gap-2">
                    <h2 class="truncate text-lg font-semibold text-foreground">{{ __($title) }}</h2>
                    @if ($count !== null && $count !== '')
                        <x-ui.badge variant="secondary" size="sm">{{ $count }}</x-ui.badge>
                    @endif
                </div>
                @if ($description)
                    <p class="mt-0.5 text-sm text-muted-foreground">{{ __($description) }}</p>
                @endif
            </div>

            <div class="flex shrink-0 items-center gap-2">
                <x-ui.button variant="ghost" size="sm">
                    <x-slot:icon>
                        <svg class="size-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
                            <path d="M3 4h18M7 10h10M11 16h2" />
                        </svg>
                    </x-slot:icon>
                    {{ __($filterLabel) }}
                </x-ui.button>

                <x-ui.button variant="default" size="sm">
                    <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="M12 5v14M5 12h14" />
                        </svg>
                    </x-slot:icon>
                    {{ __($addLabel) }}
                </x-ui.button>
            </div>
        </div>
    </div>
</header>

Ownership & lifecycle

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