Skip to content
Brok UI

Loading…

No results

Hero

Open source

Marketing hero sections: centred, split, search, form, video, stats, screenshot and more; the centred hero takes a switchable backdrop.

Preview

1 of 15
Backdrop

resources/views/blocks/hero-centered.blade.php Blade
@props([
    'eyebrow' => 'Now in public beta',
    'heading' => 'Ship polished interfaces faster',
    'subheading' => 'A Laravel-native UI and blocks system you install into your own codebase. Own the source, theme with tokens, update safely.',
    'primaryCta' => 'Get started',
    'primaryHref' => '#',
    'secondaryCta' => 'View components',
    'secondaryHref' => '#',
    'stats' => null,
    'backdrop' => 'none',
])

@php
    $stats ??= [
        ['value' => '40+', 'label' => 'Components'],
        ['value' => '20+', 'label' => 'Blocks'],
        ['value' => '100%', 'label' => 'Token themeable'],
    ];
@endphp

<section {{ $attributes->merge(['data-slot' => 'hero-centered', 'class' => 'relative isolate overflow-hidden bg-background text-foreground']) }}>
    <x-ui.backdrop :variant="$backdrop" />

    <div class="relative z-10 mx-auto max-w-4xl px-4 py-20 text-center sm:py-28">
        @if ($eyebrow)
            <x-ui.badge variant="secondary" class="mb-6">{{ __($eyebrow) }}</x-ui.badge>
        @endif

        <h1 class="text-balance text-4xl font-bold tracking-tight sm:text-5xl lg:text-6xl">
            {{ __($heading) }}
        </h1>

        <p class="mx-auto mt-6 max-w-2xl text-pretty text-lg text-muted-foreground">
            {{ __($subheading) }}
        </p>

        <div class="mt-10 flex flex-col items-center justify-center gap-4 sm:flex-row">
            <x-ui.button :href="$primaryHref" size="lg" class="w-full sm:w-auto">{{ __($primaryCta) }}</x-ui.button>
            @if ($secondaryCta)
                <x-ui.button :href="$secondaryHref" size="lg" variant="outline" class="w-full sm:w-auto">{{ __($secondaryCta) }}</x-ui.button>
            @endif
        </div>

        @if (! empty($stats))
            <dl class="mx-auto mt-16 grid max-w-2xl grid-cols-1 gap-8 sm:grid-cols-3">
                @foreach ($stats as $stat)
                    <div class="flex flex-col items-center">
                        <dt class="text-4xl font-bold tracking-tight">{{ $stat['value'] }}</dt>
                        <dd class="mt-2 text-sm text-muted-foreground">{{ __($stat['label']) }}</dd>
                    </div>
                @endforeach
            </dl>
        @endif
    </div>
</section>

Installation

terminal
php artisan ui:add blocks/hero-centered

Installs these dependencies automatically:

Registry contract

Install confidence

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

Registry dependencies

badge button backdrop

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.

hero-centered.md
# Brok UI block: Hero (centered) (`hero-centered`)

A centered marketing hero with eyebrow badge, headline, subcopy, dual call-to-action, an optional stats row, and a switchable decorative backdrop (aurora, beams, geometric, gradient, prism, liquid, dots).

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/hero-centered
```

## Render it

```blade
<x-blocks.hero-centered backdrop="none" />
```

## Props

- `eyebrow` (string, default `Now in public beta`) — Small label shown above the heading inside a badge.
- `heading` (string, default `Ship polished interfaces faster`) — Primary headline.
- `subheading` (string, default `A Laravel-native UI and blocks system you install into your own codebase. Own the source, theme with tokens, update safely.`) — Supporting copy under the heading.
- `primary-cta` (string, default `Get started`) — Primary button label.
- `primary-href` (string, default `#`) — Primary button destination.
- `secondary-cta` (string, default `View components`) — Secondary button label; falsy hides the secondary button.
- `secondary-href` (string, default `#`) — Secondary button destination.
- `stats` (array|null, default `null`) — Rows of {value, label}; null falls back to a default 3-item sample row, an empty array hides the stats section.
- `backdrop` (none|aurora|beams|geometric|gradient|prism|liquid|dots, default `none`) (variant) — Decorative layer behind the content; see the backdrop primitive.

## Use when

- Opening a marketing or landing page with a centred headline, subcopy and dual call-to-action.
- Wanting a switchable decorative background (aurora, beams, geometric, gradient, prism, liquid, dots) without maintaining a separate hero per look.

## Avoid when

- Needing a two-column layout with a product screenshot or media asset alongside the copy; use a split hero instead.
- Needing a search box, form or video as the primary interaction; use the matching specialised hero.

## Rules

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

  • Opening a marketing or landing page with a centred headline, subcopy and dual call-to-action.
  • Wanting a switchable decorative background (aurora, beams, geometric, gradient, prism, liquid, dots) without maintaining a separate hero per look.

Avoid when

  • Needing a two-column layout with a product screenshot or media asset alongside the copy; use a split hero instead.
  • Needing a search box, form or video as the primary interaction; use the matching specialised hero.

Anti-patterns

  • Do not replace semantic props with conflicting utility classes.
  • Do not remove labels, focus styles, or state attributes.
Anatomy
section backdrop eyebrow badge heading subheading primary cta secondary cta stats row

Usage

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

resources/views/welcome.blade.php Blade
<x-blocks.hero-centered />

The controls above the preview are props on this composition. What you picked reads:

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/hero-centered.blade.php Blade
@props([
    'eyebrow' => 'Now in public beta',
    'heading' => 'Ship polished interfaces faster',
    'subheading' => 'A Laravel-native UI and blocks system you install into your own codebase. Own the source, theme with tokens, update safely.',
    'primaryCta' => 'Get started',
    'primaryHref' => '#',
    'secondaryCta' => 'View components',
    'secondaryHref' => '#',
    'stats' => null,
    'backdrop' => 'none',
])

@php
    $stats ??= [
        ['value' => '40+', 'label' => 'Components'],
        ['value' => '20+', 'label' => 'Blocks'],
        ['value' => '100%', 'label' => 'Token themeable'],
    ];
@endphp

<section {{ $attributes->merge(['data-slot' => 'hero-centered', 'class' => 'relative isolate overflow-hidden bg-background text-foreground']) }}>
    <x-ui.backdrop :variant="$backdrop" />

    <div class="relative z-10 mx-auto max-w-4xl px-4 py-20 text-center sm:py-28">
        @if ($eyebrow)
            <x-ui.badge variant="secondary" class="mb-6">{{ __($eyebrow) }}</x-ui.badge>
        @endif

        <h1 class="text-balance text-4xl font-bold tracking-tight sm:text-5xl lg:text-6xl">
            {{ __($heading) }}
        </h1>

        <p class="mx-auto mt-6 max-w-2xl text-pretty text-lg text-muted-foreground">
            {{ __($subheading) }}
        </p>

        <div class="mt-10 flex flex-col items-center justify-center gap-4 sm:flex-row">
            <x-ui.button :href="$primaryHref" size="lg" class="w-full sm:w-auto">{{ __($primaryCta) }}</x-ui.button>
            @if ($secondaryCta)
                <x-ui.button :href="$secondaryHref" size="lg" variant="outline" class="w-full sm:w-auto">{{ __($secondaryCta) }}</x-ui.button>
            @endif
        </div>

        @if (! empty($stats))
            <dl class="mx-auto mt-16 grid max-w-2xl grid-cols-1 gap-8 sm:grid-cols-3">
                @foreach ($stats as $stat)
                    <div class="flex flex-col items-center">
                        <dt class="text-4xl font-bold tracking-tight">{{ $stat['value'] }}</dt>
                        <dd class="mt-2 text-sm text-muted-foreground">{{ __($stat['label']) }}</dd>
                    </div>
                @endforeach
            </dl>
        @endif
    </div>
</section>

Ownership & lifecycle

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