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

4 of 6

resources/views/blocks/blog-featured.blade.php Blade
@props([
    'heading'      => 'From the blog',
    'subheading'   => 'Insights, deep dives, and product updates from our team.',
    'viewAllHref'  => '#',
    'viewAllLabel' => 'View all articles',
    'featured'     => null,
    'posts'        => null,
])

@php
    $featured ??= [
        'category' => 'Engineering', 'title' => 'Designing a token-driven theme system for Laravel',
        'excerpt' => 'How semantic design tokens let you re-skin an entire application — light, dark, and per-surface — without touching a single component. We walk through the architecture, the pitfalls, and the decisions that made it ship.',
        'href' => '#', 'alt' => 'Abstract gradient representing layered design tokens',
        'author' => 'Avery Chen', 'initials' => 'AC', 'avatarSrc' => null,
        'date' => 'Jun 12, 2026', 'datetime' => '2026-06-12', 'readTime' => '8 min read',
    ];

    $posts ??= [
        ['category' => 'Product', 'title' => 'Own your UI: copy-in over runtime lock-in', 'href' => '#', 'author' => 'Mara Lopez', 'initials' => 'ML', 'avatarSrc' => null, 'date' => 'Jun 6, 2026', 'datetime' => '2026-06-06', 'readTime' => '5 min read'],
        ['category' => 'Accessibility', 'title' => 'Building blocks that pass WCAG 2.2 AA', 'href' => '#', 'author' => 'Sam Okafor', 'initials' => 'SO', 'avatarSrc' => null, 'date' => 'May 28, 2026', 'datetime' => '2026-05-28', 'readTime' => '6 min read'],
        ['category' => 'Design', 'title' => 'RTL-safe layout with CSS logical properties', 'href' => '#', 'author' => 'Yuki Tanaka', 'initials' => 'YT', 'avatarSrc' => null, 'date' => 'May 20, 2026', 'datetime' => '2026-05-20', 'readTime' => '4 min read'],
        ['category' => 'Tutorial', 'title' => 'Composing registry blocks into full-page layouts', 'href' => '#', 'author' => 'Priya Nair', 'initials' => 'PN', 'avatarSrc' => null, 'date' => 'May 14, 2026', 'datetime' => '2026-05-14', 'readTime' => '7 min read'],
    ];
@endphp

<x-ui.section data-slot="blog-featured" space="xl" {{ $attributes }}>
    <x-ui.container size="xl" gutter="sm">
        <div class="flex flex-wrap items-end justify-between gap-4">
            <div class="max-w-2xl">
                <h2 class="text-3xl font-bold tracking-tight sm:text-4xl">{{ __($heading) }}</h2>
                <p class="mt-4 text-sm text-muted-foreground">{{ __($subheading) }}</p>
            </div>
            <a href="{{ $viewAllHref }}" class="inline-flex items-center gap-2 text-sm font-medium text-link underline-offset-4 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring">
                {{ __($viewAllLabel) }}
                <svg aria-hidden="true" viewBox="0 0 20 20" fill="currentColor" class="size-4 shrink-0 rtl:-scale-x-100">
                    <path fill-rule="evenodd" d="M3 10a.75.75 0 0 1 .75-.75h10.638L10.23 5.29a.75.75 0 1 1 1.04-1.08l5.5 5.25a.75.75 0 0 1 0 1.08l-5.5 5.25a.75.75 0 1 1-1.04-1.08l4.158-3.96H3.75A.75.75 0 0 1 3 10Z" clip-rule="evenodd" />
                </svg>
            </a>
        </div>

        <div class="mt-12 grid grid-cols-1 gap-8 lg:grid-cols-2">
            <article class="relative flex flex-col">
                <a href="{{ $featured['href'] }}" tabindex="-1" aria-hidden="true" class="block overflow-hidden rounded-lg focus:outline-none">
                    <div class="aspect-video w-full rounded-lg bg-gradient-to-br from-primary/20 via-accent/30 to-secondary/20" role="img" aria-label="{{ __($featured['alt']) }}"></div>
                </a>
                <div class="mt-6 flex flex-1 flex-col">
                    <x-ui.badge variant="secondary" class="w-fit">{{ __($featured['category']) }}</x-ui.badge>
                    <h3 class="mt-4 text-balance text-2xl font-bold tracking-tight">
                        <a href="{{ $featured['href'] }}" class="transition-colors hover:text-link focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring">{{ __($featured['title']) }}</a>
                    </h3>
                    <p class="mt-4 flex-1 text-pretty text-sm text-muted-foreground">{{ __($featured['excerpt']) }}</p>
                    <div class="mt-6 flex items-center gap-4">
                        <x-ui.avatar :src="$featured['avatarSrc']" :alt="$featured['author']" :fallback="$featured['initials']" size="sm" />
                        <div class="min-w-0 text-sm">
                            <p class="truncate font-medium text-foreground">{{ __($featured['author']) }}</p>
                            <div class="flex flex-wrap items-center gap-x-4 text-muted-foreground">
                                <time datetime="{{ $featured['datetime'] }}">{{ __($featured['date']) }}</time>
                                <span>{{ __($featured['readTime']) }}</span>
                            </div>
                        </div>
                    </div>
                </div>
            </article>

            <div class="flex flex-col divide-y divide-border">
                @foreach ($posts as $post)
                    <article class="relative flex items-start gap-4 py-6 first:pt-0 last:pb-0">
                        <a href="{{ $post['href'] }}" tabindex="-1" aria-hidden="true" class="shrink-0 overflow-hidden rounded-lg focus:outline-none">
                            <div class="size-20 rounded-lg bg-gradient-to-br from-muted via-accent/20 to-muted-foreground/10"></div>
                        </a>
                        <div class="min-w-0 flex-1">
                            <x-ui.badge variant="outline" size="sm" class="mb-2 w-fit">{{ __($post['category']) }}</x-ui.badge>
                            <h3 class="text-sm font-semibold leading-snug tracking-tight">
                                <a href="{{ $post['href'] }}" class="transition-colors after:absolute after:inset-0 hover:text-link focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring">{{ __($post['title']) }}</a>
                            </h3>
                            <div class="mt-2 flex items-center gap-2">
                                <x-ui.avatar :src="$post['avatarSrc']" :alt="$post['author']" :fallback="$post['initials']" size="xs" />
                                <div class="flex flex-wrap items-center gap-x-4 text-sm text-muted-foreground">
                                    <span class="font-medium text-foreground">{{ __($post['author']) }}</span>
                                    <time datetime="{{ $post['datetime'] }}">{{ __($post['date']) }}</time>
                                    <span>{{ __($post['readTime']) }}</span>
                                </div>
                            </div>
                        </div>
                    </article>
                @endforeach
            </div>
        </div>
    </x-ui.container>
</x-ui.section>

Installation

terminal
php artisan ui:add blocks/blog-featured

Installs these dependencies automatically:

Registry contract

Install confidence

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

Registry dependencies

avatar badge 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-featured.md
# Brok UI block: Blog Featured (`blog-featured`)

A blog section pairing one large featured article with media, excerpt and author meta beside a compact divided list of recent posts.

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

## Render it

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

## Props

- `heading` (string, default `From the blog`)
- `subheading` (string, default `Insights, deep dives, and product updates from our team.`)
- `view-all-href` (string, default `#`)
- `view-all-label` (string, default `View all articles`)
- `featured` (mixed|null, default `null`)
- `posts` (mixed|null, default `null`)

## Use when

- Pairing one large featured article (media, excerpt, author meta) with a compact divided list of recent posts.
- Linking out to a full archive via a view-all link near the section heading.

## Avoid when

- Use blog-magazine for a stacked secondary-article list instead of a compact recent-posts sidebar.

## Rules

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

  • Pairing one large featured article (media, excerpt, author meta) with a compact divided list of recent posts.
  • Linking out to a full archive via a view-all link near the section heading.

Avoid when

  • Use blog-magazine for a stacked secondary-article list instead of a compact recent-posts sidebar.

Anti-patterns

  • Do not replace semantic props with conflicting utility classes.
  • Do not remove labels, focus styles, or state attributes.
Anatomy
root blog-featured

Usage

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

resources/views/welcome.blade.php Blade
<x-blocks.blog-featured />

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-featured.blade.php Blade
@props([
    'heading'      => 'From the blog',
    'subheading'   => 'Insights, deep dives, and product updates from our team.',
    'viewAllHref'  => '#',
    'viewAllLabel' => 'View all articles',
    'featured'     => null,
    'posts'        => null,
])

@php
    $featured ??= [
        'category' => 'Engineering', 'title' => 'Designing a token-driven theme system for Laravel',
        'excerpt' => 'How semantic design tokens let you re-skin an entire application — light, dark, and per-surface — without touching a single component. We walk through the architecture, the pitfalls, and the decisions that made it ship.',
        'href' => '#', 'alt' => 'Abstract gradient representing layered design tokens',
        'author' => 'Avery Chen', 'initials' => 'AC', 'avatarSrc' => null,
        'date' => 'Jun 12, 2026', 'datetime' => '2026-06-12', 'readTime' => '8 min read',
    ];

    $posts ??= [
        ['category' => 'Product', 'title' => 'Own your UI: copy-in over runtime lock-in', 'href' => '#', 'author' => 'Mara Lopez', 'initials' => 'ML', 'avatarSrc' => null, 'date' => 'Jun 6, 2026', 'datetime' => '2026-06-06', 'readTime' => '5 min read'],
        ['category' => 'Accessibility', 'title' => 'Building blocks that pass WCAG 2.2 AA', 'href' => '#', 'author' => 'Sam Okafor', 'initials' => 'SO', 'avatarSrc' => null, 'date' => 'May 28, 2026', 'datetime' => '2026-05-28', 'readTime' => '6 min read'],
        ['category' => 'Design', 'title' => 'RTL-safe layout with CSS logical properties', 'href' => '#', 'author' => 'Yuki Tanaka', 'initials' => 'YT', 'avatarSrc' => null, 'date' => 'May 20, 2026', 'datetime' => '2026-05-20', 'readTime' => '4 min read'],
        ['category' => 'Tutorial', 'title' => 'Composing registry blocks into full-page layouts', 'href' => '#', 'author' => 'Priya Nair', 'initials' => 'PN', 'avatarSrc' => null, 'date' => 'May 14, 2026', 'datetime' => '2026-05-14', 'readTime' => '7 min read'],
    ];
@endphp

<x-ui.section data-slot="blog-featured" space="xl" {{ $attributes }}>
    <x-ui.container size="xl" gutter="sm">
        <div class="flex flex-wrap items-end justify-between gap-4">
            <div class="max-w-2xl">
                <h2 class="text-3xl font-bold tracking-tight sm:text-4xl">{{ __($heading) }}</h2>
                <p class="mt-4 text-sm text-muted-foreground">{{ __($subheading) }}</p>
            </div>
            <a href="{{ $viewAllHref }}" class="inline-flex items-center gap-2 text-sm font-medium text-link underline-offset-4 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring">
                {{ __($viewAllLabel) }}
                <svg aria-hidden="true" viewBox="0 0 20 20" fill="currentColor" class="size-4 shrink-0 rtl:-scale-x-100">
                    <path fill-rule="evenodd" d="M3 10a.75.75 0 0 1 .75-.75h10.638L10.23 5.29a.75.75 0 1 1 1.04-1.08l5.5 5.25a.75.75 0 0 1 0 1.08l-5.5 5.25a.75.75 0 1 1-1.04-1.08l4.158-3.96H3.75A.75.75 0 0 1 3 10Z" clip-rule="evenodd" />
                </svg>
            </a>
        </div>

        <div class="mt-12 grid grid-cols-1 gap-8 lg:grid-cols-2">
            <article class="relative flex flex-col">
                <a href="{{ $featured['href'] }}" tabindex="-1" aria-hidden="true" class="block overflow-hidden rounded-lg focus:outline-none">
                    <div class="aspect-video w-full rounded-lg bg-gradient-to-br from-primary/20 via-accent/30 to-secondary/20" role="img" aria-label="{{ __($featured['alt']) }}"></div>
                </a>
                <div class="mt-6 flex flex-1 flex-col">
                    <x-ui.badge variant="secondary" class="w-fit">{{ __($featured['category']) }}</x-ui.badge>
                    <h3 class="mt-4 text-balance text-2xl font-bold tracking-tight">
                        <a href="{{ $featured['href'] }}" class="transition-colors hover:text-link focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring">{{ __($featured['title']) }}</a>
                    </h3>
                    <p class="mt-4 flex-1 text-pretty text-sm text-muted-foreground">{{ __($featured['excerpt']) }}</p>
                    <div class="mt-6 flex items-center gap-4">
                        <x-ui.avatar :src="$featured['avatarSrc']" :alt="$featured['author']" :fallback="$featured['initials']" size="sm" />
                        <div class="min-w-0 text-sm">
                            <p class="truncate font-medium text-foreground">{{ __($featured['author']) }}</p>
                            <div class="flex flex-wrap items-center gap-x-4 text-muted-foreground">
                                <time datetime="{{ $featured['datetime'] }}">{{ __($featured['date']) }}</time>
                                <span>{{ __($featured['readTime']) }}</span>
                            </div>
                        </div>
                    </div>
                </div>
            </article>

            <div class="flex flex-col divide-y divide-border">
                @foreach ($posts as $post)
                    <article class="relative flex items-start gap-4 py-6 first:pt-0 last:pb-0">
                        <a href="{{ $post['href'] }}" tabindex="-1" aria-hidden="true" class="shrink-0 overflow-hidden rounded-lg focus:outline-none">
                            <div class="size-20 rounded-lg bg-gradient-to-br from-muted via-accent/20 to-muted-foreground/10"></div>
                        </a>
                        <div class="min-w-0 flex-1">
                            <x-ui.badge variant="outline" size="sm" class="mb-2 w-fit">{{ __($post['category']) }}</x-ui.badge>
                            <h3 class="text-sm font-semibold leading-snug tracking-tight">
                                <a href="{{ $post['href'] }}" class="transition-colors after:absolute after:inset-0 hover:text-link focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring">{{ __($post['title']) }}</a>
                            </h3>
                            <div class="mt-2 flex items-center gap-2">
                                <x-ui.avatar :src="$post['avatarSrc']" :alt="$post['author']" :fallback="$post['initials']" size="xs" />
                                <div class="flex flex-wrap items-center gap-x-4 text-sm text-muted-foreground">
                                    <span class="font-medium text-foreground">{{ __($post['author']) }}</span>
                                    <time datetime="{{ $post['datetime'] }}">{{ __($post['date']) }}</time>
                                    <span>{{ __($post['readTime']) }}</span>
                                </div>
                            </div>
                        </div>
                    </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.6
Status
Stable
License
open
Deprecation
Not deprecated
Contract
v1
Foundation
≥ 1.0.0