Skip to content
Brok UI

Loading…

No results

Blog

Open source

Blog sections — a dashed list, a card grid (with an optional image panel), a magazine layout and a single-article post header.

Preview

3 of 6

resources/views/blocks/blog-magazine.blade.php Blade
@props([
    'eyebrow' => 'The Journal',
    'heading' => 'Stories, ideas, and field notes',
    'subheading' => 'Long-form writing on craft, design systems, and shipping software that lasts.',
    'featured' => null,
    'posts' => null,
])

@php
    $featured ??= [
        'category' => 'Engineering',
        'title' => 'Designing a token-driven UI system your whole team can own',
        'excerpt' => 'How we moved from a tangle of one-off colours to a single set of semantic design tokens — and what it unlocked for theming, dark mode, and shipping faster.',
        'href' => '#',
        'readTime' => '8 min read',
        'date' => 'Jun 10, 2026',
        'author' => ['name' => 'Avery Stone', 'role' => 'Principal Engineer', 'initials' => 'AS'],
    ];

    $posts ??= [
        [
            'category' => 'Design',
            'title' => 'A practical guide to building accessible components',
            'href' => '#',
            'readTime' => '6 min read',
            'date' => 'Jun 6, 2026',
            'author' => ['name' => 'Mara Lind', 'initials' => 'ML'],
        ],
        [
            'category' => 'Product',
            'title' => 'Why we copy code into your app instead of shipping a dependency',
            'href' => '#',
            'readTime' => '5 min read',
            'date' => 'Jun 2, 2026',
            'author' => ['name' => 'Jonas Reed', 'initials' => 'JR'],
        ],
        [
            'category' => 'Engineering',
            'title' => 'Keeping a registry and a docs site in perfect parity',
            'href' => '#',
            'readTime' => '7 min read',
            'date' => 'May 28, 2026',
            'author' => ['name' => 'Priya Nair', 'initials' => 'PN'],
        ],
        [
            'category' => 'Culture',
            'title' => 'Small teams, sharp tools: how we run our release week',
            'href' => '#',
            'readTime' => '4 min read',
            'date' => 'May 21, 2026',
            'author' => ['name' => 'Devin Cole', 'initials' => 'DC'],
        ],
    ];
@endphp

<x-ui.section space="xl" {{ $attributes }}>
    <x-ui.container gutter="sm">
        <div class="max-w-2xl">
            @if ($eyebrow)
                <x-ui.badge variant="secondary" class="mb-4">{{ __($eyebrow) }}</x-ui.badge>
            @endif
            <h2 class="text-3xl font-bold tracking-tight sm:text-4xl">{{ __($heading) }}</h2>
            <p class="mt-4 text-base text-muted-foreground">{{ __($subheading) }}</p>
        </div>

        <div class="mt-12 grid grid-cols-1 items-start gap-8 lg:grid-cols-3">
            {{-- Featured post --}}
            <article class="lg:col-span-2">
                <x-ui.card class="group overflow-hidden transition-shadow hover:shadow-lg">
                    <a href="{{ $featured['href'] }}" class="block focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background">
                        <x-ui.aspect-ratio ratio="16 / 9">
                            <div class="size-full bg-gradient-to-br from-primary/20 via-muted to-background transition-transform duration-300 group-hover:scale-105" aria-hidden="true"></div>
                            @if (! empty($featured['category']))
                                <div class="absolute bottom-4 start-4">
                                    <x-ui.badge>{{ __($featured['category']) }}</x-ui.badge>
                                </div>
                            @endif
                        </x-ui.aspect-ratio>

                        <div class="p-6 sm:p-8">
                            <h3 class="text-balance text-3xl font-semibold tracking-tight sm:text-4xl">
                                {{ __($featured['title']) }}
                            </h3>
                            <p class="mt-4 text-pretty text-base text-muted-foreground">
                                {{ __($featured['excerpt']) }}
                            </p>

                            <div class="mt-6 flex items-center gap-4">
                                <x-ui.avatar
                                    :src="$featured['author']['avatar'] ?? null"
                                    :alt="$featured['author']['name']"
                                    :fallback="$featured['author']['initials'] ?? null"
                                />
                                <div class="text-sm">
                                    <p class="font-medium text-foreground">{{ $featured['author']['name'] }}</p>
                                    <p class="flex flex-wrap gap-x-4 text-muted-foreground">
                                        @if (! empty($featured['author']['role']))
                                            <span>{{ __($featured['author']['role']) }}</span>
                                        @endif
                                        <span>{{ $featured['date'] }}</span>
                                    </p>
                                </div>
                                @if (! empty($featured['readTime']))
                                    <span class="ms-auto text-sm text-muted-foreground">{{ __($featured['readTime']) }}</span>
                                @endif
                            </div>
                        </div>
                    </a>
                </x-ui.card>
            </article>

            {{-- Secondary post list --}}
            <div class="flex flex-col gap-6">
                @foreach ($posts as $post)
                    <article>
                        <a href="{{ $post['href'] }}" class="group flex gap-4 rounded-md p-2 transition-colors hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background">
                            <div class="w-24 shrink-0 sm:w-28">
                                <x-ui.aspect-ratio ratio="4 / 3" class="rounded-md">
                                    <div class="size-full rounded-md bg-gradient-to-br from-primary/15 via-muted to-background transition-transform duration-300 group-hover:scale-105" aria-hidden="true"></div>
                                </x-ui.aspect-ratio>
                            </div>

                            <div class="min-w-0 flex-1">
                                @if (! empty($post['category']))
                                    <p class="text-sm font-medium uppercase tracking-wide text-primary">{{ __($post['category']) }}</p>
                                @endif
                                <h3 class="mt-2 text-pretty text-base font-semibold leading-snug text-foreground">
                                    {{ __($post['title']) }}
                                </h3>
                                <p class="mt-2 flex flex-wrap gap-x-4 text-sm text-muted-foreground">
                                    <span>{{ $post['author']['name'] }}</span>
                                    @if (! empty($post['readTime']))
                                        <span>{{ __($post['readTime']) }}</span>
                                    @endif
                                </p>
                            </div>
                        </a>
                    </article>
                @endforeach
            </div>
        </div>
    </x-ui.container>
</x-ui.section>

Installation

terminal
php artisan ui:add blocks/blog-magazine

Installs these dependencies automatically:

Registry contract

Install confidence

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

Registry dependencies

aspect-ratio avatar badge card container section

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.

blog-magazine.md
# Brok UI block: Blog Magazine (`blog-magazine`)

A magazine-style blog index with a large featured post beside a stacked list of secondary articles.

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/blog-magazine
```

## Render it

```blade
<x-blocks.blog-magazine />
```

## Props

- `eyebrow` (string, default `The Journal`)
- `heading` (string, default `Stories, ideas, and field notes`)
- `subheading` (string, default `Long-form writing on craft, design systems, and shipping software that lasts.`)
- `featured` (mixed|null, default `null`)
- `posts` (mixed|null, default `null`)

## Use when

- Leading a blog index with one large featured article beside a stacked list of secondary articles, magazine-style.
- Giving the featured post its own excerpt and media while secondary posts stay compact.

## Avoid when

- Use blog-list for a plain list or blog-image-grid for an even grid of cards without a featured post.

## Rules

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

  • Leading a blog index with one large featured article beside a stacked list of secondary articles, magazine-style.
  • Giving the featured post its own excerpt and media while secondary posts stay compact.

Avoid when

  • Use blog-list for a plain list or blog-image-grid for an even grid of cards without a featured post.

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.blog-magazine />

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/blog-magazine.blade.php Blade
@props([
    'eyebrow' => 'The Journal',
    'heading' => 'Stories, ideas, and field notes',
    'subheading' => 'Long-form writing on craft, design systems, and shipping software that lasts.',
    'featured' => null,
    'posts' => null,
])

@php
    $featured ??= [
        'category' => 'Engineering',
        'title' => 'Designing a token-driven UI system your whole team can own',
        'excerpt' => 'How we moved from a tangle of one-off colours to a single set of semantic design tokens — and what it unlocked for theming, dark mode, and shipping faster.',
        'href' => '#',
        'readTime' => '8 min read',
        'date' => 'Jun 10, 2026',
        'author' => ['name' => 'Avery Stone', 'role' => 'Principal Engineer', 'initials' => 'AS'],
    ];

    $posts ??= [
        [
            'category' => 'Design',
            'title' => 'A practical guide to building accessible components',
            'href' => '#',
            'readTime' => '6 min read',
            'date' => 'Jun 6, 2026',
            'author' => ['name' => 'Mara Lind', 'initials' => 'ML'],
        ],
        [
            'category' => 'Product',
            'title' => 'Why we copy code into your app instead of shipping a dependency',
            'href' => '#',
            'readTime' => '5 min read',
            'date' => 'Jun 2, 2026',
            'author' => ['name' => 'Jonas Reed', 'initials' => 'JR'],
        ],
        [
            'category' => 'Engineering',
            'title' => 'Keeping a registry and a docs site in perfect parity',
            'href' => '#',
            'readTime' => '7 min read',
            'date' => 'May 28, 2026',
            'author' => ['name' => 'Priya Nair', 'initials' => 'PN'],
        ],
        [
            'category' => 'Culture',
            'title' => 'Small teams, sharp tools: how we run our release week',
            'href' => '#',
            'readTime' => '4 min read',
            'date' => 'May 21, 2026',
            'author' => ['name' => 'Devin Cole', 'initials' => 'DC'],
        ],
    ];
@endphp

<x-ui.section space="xl" {{ $attributes }}>
    <x-ui.container gutter="sm">
        <div class="max-w-2xl">
            @if ($eyebrow)
                <x-ui.badge variant="secondary" class="mb-4">{{ __($eyebrow) }}</x-ui.badge>
            @endif
            <h2 class="text-3xl font-bold tracking-tight sm:text-4xl">{{ __($heading) }}</h2>
            <p class="mt-4 text-base text-muted-foreground">{{ __($subheading) }}</p>
        </div>

        <div class="mt-12 grid grid-cols-1 items-start gap-8 lg:grid-cols-3">
            {{-- Featured post --}}
            <article class="lg:col-span-2">
                <x-ui.card class="group overflow-hidden transition-shadow hover:shadow-lg">
                    <a href="{{ $featured['href'] }}" class="block focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background">
                        <x-ui.aspect-ratio ratio="16 / 9">
                            <div class="size-full bg-gradient-to-br from-primary/20 via-muted to-background transition-transform duration-300 group-hover:scale-105" aria-hidden="true"></div>
                            @if (! empty($featured['category']))
                                <div class="absolute bottom-4 start-4">
                                    <x-ui.badge>{{ __($featured['category']) }}</x-ui.badge>
                                </div>
                            @endif
                        </x-ui.aspect-ratio>

                        <div class="p-6 sm:p-8">
                            <h3 class="text-balance text-3xl font-semibold tracking-tight sm:text-4xl">
                                {{ __($featured['title']) }}
                            </h3>
                            <p class="mt-4 text-pretty text-base text-muted-foreground">
                                {{ __($featured['excerpt']) }}
                            </p>

                            <div class="mt-6 flex items-center gap-4">
                                <x-ui.avatar
                                    :src="$featured['author']['avatar'] ?? null"
                                    :alt="$featured['author']['name']"
                                    :fallback="$featured['author']['initials'] ?? null"
                                />
                                <div class="text-sm">
                                    <p class="font-medium text-foreground">{{ $featured['author']['name'] }}</p>
                                    <p class="flex flex-wrap gap-x-4 text-muted-foreground">
                                        @if (! empty($featured['author']['role']))
                                            <span>{{ __($featured['author']['role']) }}</span>
                                        @endif
                                        <span>{{ $featured['date'] }}</span>
                                    </p>
                                </div>
                                @if (! empty($featured['readTime']))
                                    <span class="ms-auto text-sm text-muted-foreground">{{ __($featured['readTime']) }}</span>
                                @endif
                            </div>
                        </div>
                    </a>
                </x-ui.card>
            </article>

            {{-- Secondary post list --}}
            <div class="flex flex-col gap-6">
                @foreach ($posts as $post)
                    <article>
                        <a href="{{ $post['href'] }}" class="group flex gap-4 rounded-md p-2 transition-colors hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background">
                            <div class="w-24 shrink-0 sm:w-28">
                                <x-ui.aspect-ratio ratio="4 / 3" class="rounded-md">
                                    <div class="size-full rounded-md bg-gradient-to-br from-primary/15 via-muted to-background transition-transform duration-300 group-hover:scale-105" aria-hidden="true"></div>
                                </x-ui.aspect-ratio>
                            </div>

                            <div class="min-w-0 flex-1">
                                @if (! empty($post['category']))
                                    <p class="text-sm font-medium uppercase tracking-wide text-primary">{{ __($post['category']) }}</p>
                                @endif
                                <h3 class="mt-2 text-pretty text-base font-semibold leading-snug text-foreground">
                                    {{ __($post['title']) }}
                                </h3>
                                <p class="mt-2 flex flex-wrap gap-x-4 text-sm text-muted-foreground">
                                    <span>{{ $post['author']['name'] }}</span>
                                    @if (! empty($post['readTime']))
                                        <span>{{ __($post['readTime']) }}</span>
                                    @endif
                                </p>
                            </div>
                        </a>
                    </article>
                @endforeach
            </div>
        </div>
    </x-ui.container>
</x-ui.section>

Ownership & lifecycle

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