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

8 of 15

resources/views/blocks/hero-video.blade.php Blade
@props([
    'badge'        => 'New',
    'headline'     => 'Ship better products, faster.',
    'lead'         => 'The all-in-one platform for modern teams — from prototype to production without the usual growing pains.',
    'primaryLabel' => 'Get started',
    'primaryHref'  => '#',
    'ghostLabel'   => 'Watch demo',
    'ghostHref'    => '#',
    'posterSrc'    => '',
    'posterAlt'    => '',
    'duration'     => '2:14',
])

@php
    $hasPoster = $posterSrc !== '';
@endphp

<section data-slot="hero-video" {{ $attributes->merge(['class' => 'relative w-full overflow-hidden bg-background py-16 text-foreground sm:py-24 lg:py-32']) }}>
    <div class="mx-auto max-w-4xl px-4 text-center">
        <div class="mb-6 flex justify-center">
            <x-ui.badge variant="secondary" class="px-4 py-2 text-sm font-medium tracking-wide">{{ __($badge) }}</x-ui.badge>
        </div>
        <h1 class="text-balance text-4xl font-bold tracking-tight text-foreground sm:text-5xl lg:text-6xl">{{ __($headline) }}</h1>
        <p class="mx-auto mt-6 max-w-2xl text-balance text-lg leading-relaxed text-muted-foreground">{{ __($lead) }}</p>
        <div class="mt-10 flex flex-wrap items-center justify-center gap-4">
            <x-ui.button variant="default" size="lg" :href="$primaryHref" :with-arrow="true">{{ __($primaryLabel) }}</x-ui.button>
            <x-ui.button variant="ghost" size="lg" :href="$ghostHref">
                <x-slot:icon>
                    <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="12" r="10" />
                        <polygon points="10 8 16 12 10 16 10 8" fill="currentColor" stroke="none" />
                    </svg>
                </x-slot:icon>
                {{ __($ghostLabel) }}
            </x-ui.button>
        </div>
    </div>

    <div class="mx-auto mt-16 max-w-5xl px-4">
        <div data-slot="hero-video-poster" class="relative aspect-video overflow-hidden rounded-lg border border-border bg-muted">
            @if ($hasPoster)
                <img src="{{ $posterSrc }}" alt="{{ __($posterAlt) }}" class="absolute inset-0 h-full w-full object-cover" loading="lazy" decoding="async" />
            @endif
            <div class="pointer-events-none absolute inset-x-0 bottom-0 h-1/3 bg-gradient-to-t from-background to-transparent" aria-hidden="true"></div>
            @if ($duration)
                <div class="absolute bottom-4 end-4 rounded-md bg-background/80 px-2 py-0.5 text-sm font-medium tabular-nums text-foreground ring-1 ring-border backdrop-blur-sm" aria-label="{{ __('Duration: :duration', ['duration' => $duration]) }}">{{ $duration }}</div>
            @endif
            <div class="absolute inset-0 flex items-center justify-center">
                <div class="absolute size-20 rounded-full bg-primary/20 motion-safe:animate-ping motion-reduce:hidden"></div>
                <button type="button" class="relative z-10 flex size-16 items-center justify-center rounded-full bg-primary text-primary-foreground shadow-lg transition-transform duration-200 hover:scale-105 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 focus-visible:ring-offset-background" aria-label="{{ __('Play video') }}">
                    <svg viewBox="0 0 24 24" fill="currentColor" class="size-7 translate-x-0.5 rtl:-translate-x-0.5 rtl:-scale-x-100" aria-hidden="true">
                        <polygon points="6 4 20 12 6 20 6 4" />
                    </svg>
                </button>
            </div>
        </div>
    </div>
</section>

Installation

terminal
php artisan ui:add blocks/hero-video

Installs these dependencies automatically:

Registry contract

Install confidence

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

Registry dependencies

badge button

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-video.md
# Brok UI block: Hero Video (`hero-video`)

A centered hero with a large bordered video poster, a circular play button with a reduced-motion-safe pulse ring, a duration chip and dual call-to-action buttons.

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

## Render it

```blade
<x-blocks.hero-video />
```

## Props

- `badge` (string, default `New`) — Small label shown above the headline inside a badge.
- `headline` (string, default `Ship better products, faster.`) — Primary headline.
- `lead` (string, default `The all-in-one platform for modern teams — from prototype to production without the usual growing pains.`) — Supporting copy under the headline.
- `primary-label` (string, default `Get started`) — Primary button label.
- `primary-href` (string, default `#`) — Primary button destination.
- `ghost-label` (string, default `Watch demo`) — Ghost secondary button label.
- `ghost-href` (string, default `#`) — Ghost secondary button destination.
- `poster-src` (string) — Poster image URL shown behind the play button; empty string shows the muted placeholder background.
- `poster-alt` (string) — Alt text for the poster image.
- `duration` (string, default `2:14`) — Video duration chip text shown over the poster; falsy hides the chip.

## Use when

- Opening a marketing page anchored by a product demo video, with a poster image, a duration chip and a large play button as the visual focus.
- Wanting dual CTAs — a primary action and a ghost 'watch demo' action — above the video poster.

## Avoid when

- Needing a static product screenshot instead of a video-style focal point; use hero-screenshot or hero-mockup's browser-mockup screenshot instead.

## Rules

- Render the installed block with `<x-blocks.hero-video />` 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-video
- Registry JSON (files, props, contract): https://brokui.dev/r/open/blocks/hero-video.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 page anchored by a product demo video, with a poster image, a duration chip and a large play button as the visual focus.
  • Wanting dual CTAs — a primary action and a ghost 'watch demo' action — above the video poster.

Avoid when

  • Needing a static product screenshot instead of a video-style focal point; use hero-screenshot or hero-mockup's browser-mockup screenshot instead.

Anti-patterns

  • Do not replace semantic props with conflicting utility classes.
  • Do not remove labels, focus styles, or state attributes.
Anatomy
badge headline lead primary cta ghost cta with play icon video poster play button duration chip

Usage

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

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

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-video.blade.php Blade
@props([
    'badge'        => 'New',
    'headline'     => 'Ship better products, faster.',
    'lead'         => 'The all-in-one platform for modern teams — from prototype to production without the usual growing pains.',
    'primaryLabel' => 'Get started',
    'primaryHref'  => '#',
    'ghostLabel'   => 'Watch demo',
    'ghostHref'    => '#',
    'posterSrc'    => '',
    'posterAlt'    => '',
    'duration'     => '2:14',
])

@php
    $hasPoster = $posterSrc !== '';
@endphp

<section data-slot="hero-video" {{ $attributes->merge(['class' => 'relative w-full overflow-hidden bg-background py-16 text-foreground sm:py-24 lg:py-32']) }}>
    <div class="mx-auto max-w-4xl px-4 text-center">
        <div class="mb-6 flex justify-center">
            <x-ui.badge variant="secondary" class="px-4 py-2 text-sm font-medium tracking-wide">{{ __($badge) }}</x-ui.badge>
        </div>
        <h1 class="text-balance text-4xl font-bold tracking-tight text-foreground sm:text-5xl lg:text-6xl">{{ __($headline) }}</h1>
        <p class="mx-auto mt-6 max-w-2xl text-balance text-lg leading-relaxed text-muted-foreground">{{ __($lead) }}</p>
        <div class="mt-10 flex flex-wrap items-center justify-center gap-4">
            <x-ui.button variant="default" size="lg" :href="$primaryHref" :with-arrow="true">{{ __($primaryLabel) }}</x-ui.button>
            <x-ui.button variant="ghost" size="lg" :href="$ghostHref">
                <x-slot:icon>
                    <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="12" r="10" />
                        <polygon points="10 8 16 12 10 16 10 8" fill="currentColor" stroke="none" />
                    </svg>
                </x-slot:icon>
                {{ __($ghostLabel) }}
            </x-ui.button>
        </div>
    </div>

    <div class="mx-auto mt-16 max-w-5xl px-4">
        <div data-slot="hero-video-poster" class="relative aspect-video overflow-hidden rounded-lg border border-border bg-muted">
            @if ($hasPoster)
                <img src="{{ $posterSrc }}" alt="{{ __($posterAlt) }}" class="absolute inset-0 h-full w-full object-cover" loading="lazy" decoding="async" />
            @endif
            <div class="pointer-events-none absolute inset-x-0 bottom-0 h-1/3 bg-gradient-to-t from-background to-transparent" aria-hidden="true"></div>
            @if ($duration)
                <div class="absolute bottom-4 end-4 rounded-md bg-background/80 px-2 py-0.5 text-sm font-medium tabular-nums text-foreground ring-1 ring-border backdrop-blur-sm" aria-label="{{ __('Duration: :duration', ['duration' => $duration]) }}">{{ $duration }}</div>
            @endif
            <div class="absolute inset-0 flex items-center justify-center">
                <div class="absolute size-20 rounded-full bg-primary/20 motion-safe:animate-ping motion-reduce:hidden"></div>
                <button type="button" class="relative z-10 flex size-16 items-center justify-center rounded-full bg-primary text-primary-foreground shadow-lg transition-transform duration-200 hover:scale-105 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 focus-visible:ring-offset-background" aria-label="{{ __('Play video') }}">
                    <svg viewBox="0 0 24 24" fill="currentColor" class="size-7 translate-x-0.5 rtl:-translate-x-0.5 rtl:-scale-x-100" aria-hidden="true">
                        <polygon points="6 4 20 12 6 20 6 4" />
                    </svg>
                </button>
            </div>
        </div>
    </div>
</section>

Ownership & lifecycle

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