Skip to content
Brok UI

Loading…

No results

Description List

Open source

Detail panels — key/value information rendered as a semantic description list with a status badge and attachments.

Preview

resources/views/blocks/description-list-sections.blade.php Blade
@props([
    'heading'    => 'Account overview',
    'subheading' => 'Manage your personal details, contact information, billing, and preferences.',
    'sections'   => null,
])

@php
    $sections ??= [
        ['title' => 'Personal details', 'rows' => [
            ['label' => 'Full name', 'value' => 'Morgan Avery', 'type' => 'text'],
            ['label' => 'Display name', 'value' => 'morgan.avery', 'type' => 'text'],
            ['label' => 'Date of birth', 'value' => 'March 14, 1990', 'type' => 'text'],
            ['label' => 'Account status', 'value' => 'Active', 'type' => 'badge', 'variant' => 'success'],
        ]],
        ['title' => 'Contact', 'rows' => [
            ['label' => 'Email address', 'value' => 'morgan.avery@example.com', 'type' => 'text'],
            ['label' => 'Phone number', 'value' => '+1 (555) 234-5678', 'type' => 'text'],
            ['label' => 'Time zone', 'value' => 'America/New_York (UTC−5)', 'type' => 'text'],
        ]],
        ['title' => 'Billing', 'rows' => [
            ['label' => 'Plan', 'value' => 'Pro', 'type' => 'badge', 'variant' => 'default'],
            ['label' => 'Renewal date', 'value' => 'July 1, 2026', 'type' => 'text'],
            ['label' => 'Payment method', 'value' => 'Visa ending in 4242', 'type' => 'text'],
            ['label' => 'Billing address', 'value' => '742 Evergreen Terrace, Springfield, IL', 'type' => 'text'],
        ]],
        ['title' => 'Preferences', 'rows' => [
            ['label' => 'Language', 'value' => 'English (US)', 'type' => 'text'],
            ['label' => 'Theme', 'value' => 'System default', 'type' => 'text'],
            ['label' => 'Marketing emails', 'value' => 'Opted out', 'type' => 'badge', 'variant' => 'outline'],
        ]],
    ];
@endphp

<x-ui.section space="md" {{ $attributes }}>
    <div class="mx-auto max-w-3xl space-y-6 px-4">
        <div class="space-y-2">
            <h1 class="text-2xl font-semibold leading-7">{{ __($heading) }}</h1>
            @if ($subheading)<p class="text-sm text-muted-foreground">{{ __($subheading) }}</p>@endif
        </div>

        @foreach ($sections as $section)
            <x-ui.card class="overflow-hidden">
                <div class="flex items-center justify-between gap-4 border-b border-border px-6 py-4">
                    <h2 class="text-base font-semibold leading-6">{{ __($section['title']) }}</h2>
                    <x-ui.button variant="ghost" size="sm" class="shrink-0">
                        <x-slot:icon><svg class="size-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z" /><path d="m15 5 4 4" /></svg></x-slot:icon>
                        {{ __('Edit') }}
                    </x-ui.button>
                </div>
                <x-ui.fact-list layout="grid" size="lg" :facts="$section['rows']" class="px-6" />
            </x-ui.card>
        @endforeach
    </div>
</x-ui.section>

Installation

terminal
php artisan ui:add blocks/description-list-sections

Installs these dependencies automatically:

Registry contract

Install confidence

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

Registry dependencies

badge button card section fact-list

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.

description-list-sections.md
# Brok UI block: Description List Cards (`description-list-sections`)

A description list split into grouped section cards (personal, contact, billing, preferences), each a key/value list with an edit action.

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/description-list-sections
```

## Render it

```blade
<x-blocks.description-list-sections />
```

## Props

- `heading` (string, default `Account overview`)
- `subheading` (string, default `Manage your personal details, contact information, billing, and preferences.`)
- `sections` (mixed|null, default `null`)

## Use when

- Splitting account details into grouped section cards (personal, contact, billing, preferences) each with its own edit action.
- Fitting a settings-overview page that benefits from clearly separated topic groups rather than one long list.

## Avoid when

- Use description-list-detail or description-list-inline for a single, ungrouped list of key/value rows instead.

## Rules

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

  • Splitting account details into grouped section cards (personal, contact, billing, preferences) each with its own edit action.
  • Fitting a settings-overview page that benefits from clearly separated topic groups rather than one long list.

Avoid when

  • Use description-list-detail or description-list-inline for a single, ungrouped list of key/value rows instead.

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.description-list-sections />

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/description-list-sections.blade.php Blade
@props([
    'heading'    => 'Account overview',
    'subheading' => 'Manage your personal details, contact information, billing, and preferences.',
    'sections'   => null,
])

@php
    $sections ??= [
        ['title' => 'Personal details', 'rows' => [
            ['label' => 'Full name', 'value' => 'Morgan Avery', 'type' => 'text'],
            ['label' => 'Display name', 'value' => 'morgan.avery', 'type' => 'text'],
            ['label' => 'Date of birth', 'value' => 'March 14, 1990', 'type' => 'text'],
            ['label' => 'Account status', 'value' => 'Active', 'type' => 'badge', 'variant' => 'success'],
        ]],
        ['title' => 'Contact', 'rows' => [
            ['label' => 'Email address', 'value' => 'morgan.avery@example.com', 'type' => 'text'],
            ['label' => 'Phone number', 'value' => '+1 (555) 234-5678', 'type' => 'text'],
            ['label' => 'Time zone', 'value' => 'America/New_York (UTC−5)', 'type' => 'text'],
        ]],
        ['title' => 'Billing', 'rows' => [
            ['label' => 'Plan', 'value' => 'Pro', 'type' => 'badge', 'variant' => 'default'],
            ['label' => 'Renewal date', 'value' => 'July 1, 2026', 'type' => 'text'],
            ['label' => 'Payment method', 'value' => 'Visa ending in 4242', 'type' => 'text'],
            ['label' => 'Billing address', 'value' => '742 Evergreen Terrace, Springfield, IL', 'type' => 'text'],
        ]],
        ['title' => 'Preferences', 'rows' => [
            ['label' => 'Language', 'value' => 'English (US)', 'type' => 'text'],
            ['label' => 'Theme', 'value' => 'System default', 'type' => 'text'],
            ['label' => 'Marketing emails', 'value' => 'Opted out', 'type' => 'badge', 'variant' => 'outline'],
        ]],
    ];
@endphp

<x-ui.section space="md" {{ $attributes }}>
    <div class="mx-auto max-w-3xl space-y-6 px-4">
        <div class="space-y-2">
            <h1 class="text-2xl font-semibold leading-7">{{ __($heading) }}</h1>
            @if ($subheading)<p class="text-sm text-muted-foreground">{{ __($subheading) }}</p>@endif
        </div>

        @foreach ($sections as $section)
            <x-ui.card class="overflow-hidden">
                <div class="flex items-center justify-between gap-4 border-b border-border px-6 py-4">
                    <h2 class="text-base font-semibold leading-6">{{ __($section['title']) }}</h2>
                    <x-ui.button variant="ghost" size="sm" class="shrink-0">
                        <x-slot:icon><svg class="size-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z" /><path d="m15 5 4 4" /></svg></x-slot:icon>
                        {{ __('Edit') }}
                    </x-ui.button>
                </div>
                <x-ui.fact-list layout="grid" size="lg" :facts="$section['rows']" class="px-6" />
            </x-ui.card>
        @endforeach
    </div>
</x-ui.section>

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