Skip to content
Brok UI

Loading…

No results

Footer

Open source

Site footers — a columns layout, a newsletter lead, a centered minimal, a wide mega footer and a CTA-led footer.

Preview

3 of 8

resources/views/blocks/footer-centered.blade.php Blade
@props([
    'brand' => 'Acme',
    'links' => null,
    'socials' => null,
    'statusLabel' => 'All systems operational',
    'copyright' => null,
])

@php
    $links ??= [
        ['label' => 'Features', 'href' => '#'],
        ['label' => 'Pricing', 'href' => '#'],
        ['label' => 'Docs', 'href' => '#'],
        ['label' => 'Blog', 'href' => '#'],
        ['label' => 'Changelog', 'href' => '#'],
        ['label' => 'Support', 'href' => '#'],
    ];

    $socials ??= [
        ['label' => 'X', 'href' => '#', 'icon' => 'x'],
        ['label' => 'GitHub', 'href' => '#', 'icon' => 'github'],
        ['label' => 'LinkedIn', 'href' => '#', 'icon' => 'linkedin'],
    ];

    // Map the block's `socials` contract onto social-links: `platform` (or the older
    // `icon` key / a label) picks the mark; a raw `path` becomes a custom `icon`.
    $socialLinks = array_map(fn (array $s) => [
        'platform' => $s['platform'] ?? (isset($s['icon']) && ! str_contains($s['icon'], '<') ? $s['icon'] : strtolower(str_replace('.', '', $s['label'] ?? 'x'))),
        'label' => $s['label'] ?? null,
        'href' => $s['href'] ?? '#',
        'icon' => isset($s['path']) ? '<path d="'.$s['path'].'"/>' : (isset($s['icon']) && str_contains($s['icon'], '<') ? $s['icon'] : null),
    ], $socials);

    $copyright ??= '© '.date('Y').' '.$brand.'. '.__('All rights reserved.');
@endphp

<footer {{ $attributes->merge(['class' => 'border-t border-border bg-background text-foreground']) }}>
    <div class="mx-auto max-w-3xl px-4 py-16 text-center sm:py-20">
        <a href="#" class="inline-block text-2xl font-bold tracking-tight sm:text-3xl">
            {{ $brand }}
        </a>

        @if (! empty($links))
            <nav aria-label="{{ __('Footer') }}" class="mt-8">
                <ul class="flex flex-wrap items-center justify-center gap-x-6 gap-y-4 text-sm">
                    @foreach ($links as $link)
                        <li>
                            <a href="{{ $link['href'] }}" class="text-muted-foreground transition-colors hover:text-foreground focus-visible:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background">{{ __($link['label']) }}</a>
                        </li>
                    @endforeach
                </ul>
            </nav>
        @endif

        @if (! empty($socialLinks))
            <x-ui.social-links :links="$socialLinks" shape="full" variant="outline" class="mt-8 justify-center" />
        @endif

        @if ($statusLabel)
            <div class="mt-8 flex justify-center">
                <x-ui.status variant="online" :label="__($statusLabel)" pulse />
            </div>
        @endif

        <x-ui.separator class="my-10" />

        <p class="text-sm text-muted-foreground">{{ $copyright }}</p>
    </div>
</footer>

Installation

terminal
php artisan ui:add blocks/footer-centered

Installs these dependencies automatically:

Registry contract

Install confidence

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

Registry dependencies

separator status social-links

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.

footer-centered.md
# Brok UI block: Footer Centered (`footer-centered`)

A centered minimal footer with a large wordmark, a wrapping nav-link row, social icon links, an 'all systems operational' status line, a separator, and a muted copyright line.

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

## Render it

```blade
<x-blocks.footer-centered />
```

## Props

- `brand` (string, default `Acme`)
- `links` (mixed|null, default `null`)
- `socials` (mixed|null, default `null`)
- `status-label` (string, default `All systems operational`)
- `copyright` (mixed|null, default `null`)

## Use when

- Closing a site with a centred minimal footer: a large wordmark, a wrapping nav-link row and social icons.
- Surfacing an 'all systems operational' status line above a muted copyright line.

## Avoid when

- Use footer-columns for a full multi-column footer, or footer-minimal for an even more minimal single-row footer.

## Rules

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

  • Closing a site with a centred minimal footer: a large wordmark, a wrapping nav-link row and social icons.
  • Surfacing an 'all systems operational' status line above a muted copyright line.

Avoid when

  • Use footer-columns for a full multi-column footer, or footer-minimal for an even more minimal single-row footer.

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.footer-centered />

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/footer-centered.blade.php Blade
@props([
    'brand' => 'Acme',
    'links' => null,
    'socials' => null,
    'statusLabel' => 'All systems operational',
    'copyright' => null,
])

@php
    $links ??= [
        ['label' => 'Features', 'href' => '#'],
        ['label' => 'Pricing', 'href' => '#'],
        ['label' => 'Docs', 'href' => '#'],
        ['label' => 'Blog', 'href' => '#'],
        ['label' => 'Changelog', 'href' => '#'],
        ['label' => 'Support', 'href' => '#'],
    ];

    $socials ??= [
        ['label' => 'X', 'href' => '#', 'icon' => 'x'],
        ['label' => 'GitHub', 'href' => '#', 'icon' => 'github'],
        ['label' => 'LinkedIn', 'href' => '#', 'icon' => 'linkedin'],
    ];

    // Map the block's `socials` contract onto social-links: `platform` (or the older
    // `icon` key / a label) picks the mark; a raw `path` becomes a custom `icon`.
    $socialLinks = array_map(fn (array $s) => [
        'platform' => $s['platform'] ?? (isset($s['icon']) && ! str_contains($s['icon'], '<') ? $s['icon'] : strtolower(str_replace('.', '', $s['label'] ?? 'x'))),
        'label' => $s['label'] ?? null,
        'href' => $s['href'] ?? '#',
        'icon' => isset($s['path']) ? '<path d="'.$s['path'].'"/>' : (isset($s['icon']) && str_contains($s['icon'], '<') ? $s['icon'] : null),
    ], $socials);

    $copyright ??= '© '.date('Y').' '.$brand.'. '.__('All rights reserved.');
@endphp

<footer {{ $attributes->merge(['class' => 'border-t border-border bg-background text-foreground']) }}>
    <div class="mx-auto max-w-3xl px-4 py-16 text-center sm:py-20">
        <a href="#" class="inline-block text-2xl font-bold tracking-tight sm:text-3xl">
            {{ $brand }}
        </a>

        @if (! empty($links))
            <nav aria-label="{{ __('Footer') }}" class="mt-8">
                <ul class="flex flex-wrap items-center justify-center gap-x-6 gap-y-4 text-sm">
                    @foreach ($links as $link)
                        <li>
                            <a href="{{ $link['href'] }}" class="text-muted-foreground transition-colors hover:text-foreground focus-visible:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background">{{ __($link['label']) }}</a>
                        </li>
                    @endforeach
                </ul>
            </nav>
        @endif

        @if (! empty($socialLinks))
            <x-ui.social-links :links="$socialLinks" shape="full" variant="outline" class="mt-8 justify-center" />
        @endif

        @if ($statusLabel)
            <div class="mt-8 flex justify-center">
                <x-ui.status variant="online" :label="__($statusLabel)" pulse />
            </div>
        @endif

        <x-ui.separator class="my-10" />

        <p class="text-sm text-muted-foreground">{{ $copyright }}</p>
    </div>
</footer>

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