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

2 of 6

resources/views/blocks/blog-list.blade.php Blade
@props([
    'heading' => 'From the blog',
    'subheading' => 'Notes on building, shipping, and theming Laravel-native interfaces.',
    'posts' => null,
])

@php
    $posts ??= [
        [
            'title' => 'Owning your UI: copy-in components without runtime lock-in',
            'href' => '#',
            'excerpt' => 'Why copying plain Blade into your project beats a black-box dependency, and how token-driven theming keeps every surface consistent without forking the framework.',
            'date' => 'June 12, 2026',
            'dateIso' => '2026-06-12',
            'category' => 'Engineering',
            'author' => 'Avery Nolan',
            'initials' => 'AN',
            'readTime' => '5 min read',
        ],
        [
            'title' => 'Designing with semantic tokens instead of hex values',
            'href' => '#',
            'excerpt' => 'A practical look at mapping background, foreground, and accent roles to CSS variables so light, dark, and per-surface themes fall out for free.',
            'date' => 'June 6, 2026',
            'dateIso' => '2026-06-06',
            'category' => 'Design',
            'author' => 'Mira Castellano',
            'initials' => 'MC',
            'readTime' => '7 min read',
        ],
        [
            'title' => 'Accessible by default: the WCAG checklist we ship with',
            'href' => '#',
            'excerpt' => 'Keyboard paths, focus-visible states, ARIA wiring, and RTL-safe logical properties — the baseline every block clears before it lands in the registry.',
            'date' => 'May 28, 2026',
            'dateIso' => '2026-05-28',
            'category' => 'Accessibility',
            'author' => 'Devin Park',
            'initials' => 'DP',
            'readTime' => '6 min read',
        ],
    ];
@endphp

<x-ui.section space="xl" {{ $attributes }}>
    <div class="mx-auto max-w-3xl px-4">
        <header class="max-w-2xl">
            <h2 class="text-3xl font-bold tracking-tight sm:text-4xl">{{ __($heading) }}</h2>
            <p class="mt-4 text-xl text-muted-foreground">{{ __($subheading) }}</p>
        </header>

        <div class="mt-12 divide-y divide-dashed divide-border">
            @foreach ($posts as $post)
                <article class="group relative py-8 first:pt-0 last:pb-0">
                    <div class="flex flex-wrap items-center gap-x-4 gap-y-2 text-sm text-muted-foreground">
                        <time datetime="{{ $post['dateIso'] }}">{{ __($post['date']) }}</time>
                        @if (! empty($post['category']))
                            <x-ui.separator orientation="vertical" class="h-4" aria-hidden="true" />
                            <x-ui.badge variant="secondary">{{ __($post['category']) }}</x-ui.badge>
                        @endif
                    </div>

                    <h3 class="mt-4 text-xl font-semibold tracking-tight text-balance">
                        <a
                            href="{{ $post['href'] }}"
                            class="rounded-sm outline-none transition-colors hover:text-primary focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background"
                        >
                            <span class="absolute inset-0" aria-hidden="true"></span>
                            {{ __($post['title']) }}
                        </a>
                    </h3>

                    <p class="mt-4 text-pretty text-muted-foreground">{{ __($post['excerpt']) }}</p>

                    <footer class="mt-6 flex items-center gap-4">
                        <x-ui.avatar size="sm" :alt="$post['author']" :fallback="$post['initials']" />
                        <div class="flex flex-wrap items-center gap-x-4 text-sm">
                            <span class="font-medium text-foreground">{{ __($post['author']) }}</span>
                            <span class="text-muted-foreground">{{ __($post['readTime']) }}</span>
                        </div>
                    </footer>
                </article>
            @endforeach
        </div>
    </div>
</x-ui.section>

Installation

terminal
php artisan ui:add blocks/blog-list

Installs these dependencies automatically:

Registry contract

Install confidence

php artisan ui:add blocks/blog-list 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-list.blade.php

Registry dependencies

avatar badge section separator

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-list.md
# Brok UI block: Blog List (`blog-list`)

A single-column blog index with dashed dividers, each row showing date, category badge, a linked title, excerpt, and an author avatar with read time.

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

## Render it

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

## Props

- `heading` (string, default `From the blog`)
- `subheading` (string, default `Notes on building, shipping, and theming Laravel-native interfaces.`)
- `posts` (mixed|null, default `null`)

## Use when

- Listing blog posts as a single dashed-divider column, each row showing date, category, title, excerpt and author.
- Keeping the index compact and text-led rather than image-heavy.

## Avoid when

- Use blog-image-grid for an image-card grid, or blog-magazine/blog-featured for a magazine layout with a featured post.

## Rules

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

  • Listing blog posts as a single dashed-divider column, each row showing date, category, title, excerpt and author.
  • Keeping the index compact and text-led rather than image-heavy.

Avoid when

  • Use blog-image-grid for an image-card grid, or blog-magazine/blog-featured for a magazine layout with 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-list />

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-list.blade.php Blade
@props([
    'heading' => 'From the blog',
    'subheading' => 'Notes on building, shipping, and theming Laravel-native interfaces.',
    'posts' => null,
])

@php
    $posts ??= [
        [
            'title' => 'Owning your UI: copy-in components without runtime lock-in',
            'href' => '#',
            'excerpt' => 'Why copying plain Blade into your project beats a black-box dependency, and how token-driven theming keeps every surface consistent without forking the framework.',
            'date' => 'June 12, 2026',
            'dateIso' => '2026-06-12',
            'category' => 'Engineering',
            'author' => 'Avery Nolan',
            'initials' => 'AN',
            'readTime' => '5 min read',
        ],
        [
            'title' => 'Designing with semantic tokens instead of hex values',
            'href' => '#',
            'excerpt' => 'A practical look at mapping background, foreground, and accent roles to CSS variables so light, dark, and per-surface themes fall out for free.',
            'date' => 'June 6, 2026',
            'dateIso' => '2026-06-06',
            'category' => 'Design',
            'author' => 'Mira Castellano',
            'initials' => 'MC',
            'readTime' => '7 min read',
        ],
        [
            'title' => 'Accessible by default: the WCAG checklist we ship with',
            'href' => '#',
            'excerpt' => 'Keyboard paths, focus-visible states, ARIA wiring, and RTL-safe logical properties — the baseline every block clears before it lands in the registry.',
            'date' => 'May 28, 2026',
            'dateIso' => '2026-05-28',
            'category' => 'Accessibility',
            'author' => 'Devin Park',
            'initials' => 'DP',
            'readTime' => '6 min read',
        ],
    ];
@endphp

<x-ui.section space="xl" {{ $attributes }}>
    <div class="mx-auto max-w-3xl px-4">
        <header class="max-w-2xl">
            <h2 class="text-3xl font-bold tracking-tight sm:text-4xl">{{ __($heading) }}</h2>
            <p class="mt-4 text-xl text-muted-foreground">{{ __($subheading) }}</p>
        </header>

        <div class="mt-12 divide-y divide-dashed divide-border">
            @foreach ($posts as $post)
                <article class="group relative py-8 first:pt-0 last:pb-0">
                    <div class="flex flex-wrap items-center gap-x-4 gap-y-2 text-sm text-muted-foreground">
                        <time datetime="{{ $post['dateIso'] }}">{{ __($post['date']) }}</time>
                        @if (! empty($post['category']))
                            <x-ui.separator orientation="vertical" class="h-4" aria-hidden="true" />
                            <x-ui.badge variant="secondary">{{ __($post['category']) }}</x-ui.badge>
                        @endif
                    </div>

                    <h3 class="mt-4 text-xl font-semibold tracking-tight text-balance">
                        <a
                            href="{{ $post['href'] }}"
                            class="rounded-sm outline-none transition-colors hover:text-primary focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background"
                        >
                            <span class="absolute inset-0" aria-hidden="true"></span>
                            {{ __($post['title']) }}
                        </a>
                    </h3>

                    <p class="mt-4 text-pretty text-muted-foreground">{{ __($post['excerpt']) }}</p>

                    <footer class="mt-6 flex items-center gap-4">
                        <x-ui.avatar size="sm" :alt="$post['author']" :fallback="$post['initials']" />
                        <div class="flex flex-wrap items-center gap-x-4 text-sm">
                            <span class="font-medium text-foreground">{{ __($post['author']) }}</span>
                            <span class="text-muted-foreground">{{ __($post['readTime']) }}</span>
                        </div>
                    </footer>
                </article>
            @endforeach
        </div>
    </div>
</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