Skip to content
Brok UI

Loading…

No results

Record Section

Open source

One subject on a record page or quick-view sheet — a small caps title, one sentence saying what the section decides, an optional aside or 'view details' link, and the content in a card.

Version
v1.0.1
Stability
stable
License
MIT
Related
Card
Fact List
Record Tabs
Quick Drawer

Preview

Shipping

Where this order ships and which carrier service it was booked with.

Address
Keizersgracht 12, 1015 CN Amsterdam
Carrier
PostNL — Standard
Tracking
3SABCD1234567
previews.components.admin-record-section.default.blade.php Blade
<div class="w-full">
    <x-ui.admin.record-section />
</div>

Installation

terminal
php artisan ui:add admin-record-section

Registry contract

php artisan ui:add admin-record-section writes only the files below. The CLI validates each file hash before writing and asks before it replaces a local change, unless you pass --force.

  • blade resources/views/components/ui/admin/record-section.blade.php
Registry dependencies
card button fact-list
Packages
composer: jml/brok:^0.2

Use with AI

A brief for your coding agent: install command, usage, props, guidance and the rules. Copy it, or open a prompt about this component in an assistant.

admin-record-section.md
# Brok UI: Record Section (`admin-record-section`)

One subject on a record page or quick-view sheet — a small caps title, one sentence saying what the section decides, an optional aside or 'view details' link, and the content in a card.

Brok UI is a Laravel Blade component registry. Installed components are plain Blade files the app owns.

## Install

```bash
php artisan ui:add admin-record-section
```

## Usage

```blade
<div class="w-full">
    <x-ui.admin.record-section />
</div>
```

## Props

- `title` (string, default `Shipping`) — Small caps section title.
- `hint` (string|false|null, default `null`) — One sentence on what the section decides; `null` renders a sample, `false` renders none.
- `id` (string|null, default `null`) — Deep-link and blocker target.
- `moreLabel` (string|null, default `null`) — Label of the aside link.
- `moreHref` (string|null, default `null`) — Renders a 'view details' link in the title row.

## Use when

- Use to structure hierarchy, spacing, and responsiveness so content is easier to scan and navigate.
- Every section of a record page and every subject block on a quick-view sheet, so the rhythm is one object.
- A form groups its fields by decision (what kind, who, when).

## Avoid when

- Do not let layout primitives substitute for semantics, headings, or interaction rules users still need.
- A marketing section — use `section` and `section-heading`.
- A collapsible group — use `accordion` or `collapsible`.

## Anti-patterns

- Using visual layout as a substitute for semantic structure

## Rules

- Use the `<brok:admin-record-section>` tag (or `<x-ui.admin-record-section>`) in Blade; do not rewrite the component.
- Prefer the documented props and variants over utility-class overrides; when a utility must win, use the `!` important modifier.
- Use semantic design tokens (`bg-primary`, `text-muted-foreground`), never raw colour utilities.
- Keep the `data-slot` attributes; they are the styling and test hooks.

## Links

- Docs: https://brokui.dev/docs/components/admin-record-section
- Registry JSON (files, props, contract): https://brokui.dev/r/open/admin-record-section.json

Working in Claude Code, Cursor or Codex? Give the agent the whole registry through the MCP server or the Brok UI skill.

API

manifest knowledge + registry-derived coverage

Props

Props accepted by this component: name, type, default value and description.
Prop Type Default Description
title string Shipping Small caps section title.
hint string | false | null null One sentence on what the section decides; `null` renders a sample, `false` renders none.
id string | null null Deep-link and blocker target.
moreLabel string | null null Label of the aside link.
moreHref string | null null Renders a 'view details' link in the title row.

Slots

  • default — The section body; a sample fact list renders when omitted.
  • aside — Anything for the end side of the title row; wins over `moreHref`.

Data slots

Stable hooks for CSS overrides and browser tests.

record-section record-section-aside record-section-body record-section-hint record-section-title

Behavior

  • The title row wraps its aside under the title on a narrow screen instead of truncating either.
  • Declares registry capability flags: a11y, responsive, rtl, darkMode, localized.

Guidance

Layout and content structure

Structure content hierarchy and responsive relationships.

Use when

  • Use to structure hierarchy, spacing, and responsiveness so content is easier to scan and navigate.
  • Every section of a record page and every subject block on a quick-view sheet, so the rhythm is one object.
  • A form groups its fields by decision (what kind, who, when).

Avoid when

  • Do not let layout primitives substitute for semantics, headings, or interaction rules users still need.
  • A marketing section — use `section` and `section-heading`.
  • A collapsible group — use `accordion` or `collapsible`.

Use instead

  • Semantic HTML with standard flow

Anti-patterns

  • Using visual layout as a substitute for semantic structure
Anatomy
record-section record-section-title record-section-aside record-section-hint record-section-body
Theming hooks
record-section

Accessibility

WCAG 2.2 AA Keyboard focus-visible RTL-ready Localized labels Dark mode
Keyboard
No component-owned keyboard interaction; native element behavior applies.
Focus
none
  • The title is a real `<h2>` inside a `<section>`, so the page outline lists every subject.
  • Semantic HTML and a stable data-slot attribute for styling and scripting hooks.
  • Focus-visible rings use the ring token, so keyboard focus is always visible.
  • Disabled and invalid states are conveyed to assistive tech, not by color alone.
  • Targets WCAG 2.2 AA; verify contrast in light, dark, admin and customer surfaces in the preview.
  • Labels go through __() and layout uses logical properties (ms-*, text-start), so it mirrors under dir="rtl" — flip the preview to RTL to confirm.
  • Dark mode uses the same semantic tokens under the dark class; high contrast follows forced-color system tokens.

Livewire

Safe

Livewire can update this component through forwarded wire:* attributes.

Source

The exact, editable file ui:add writes into your app. Previews render this same code; there are no preview-only components.

resources/views/components/ui/admin/record-section.blade.php Blade
{{--
    Record Section — one subject on a record page or a quick-view sheet: a
    small caps title, one sentence saying what the section decides, an
    optional aside on the title row, and the content.

    It exists so every section in an admin is the same object and the rhythm
    cannot drift. The Noord-C admin carried thirteen module copies of this
    file under the same name plus ten "sheet-section" copies in its quick
    views; the only difference between them was whether the title row also
    offered a way into the tab that owns the subject. That is the `aside`
    slot (or, for the common case, `moreLabel` + `moreHref`).

    `id` makes a section a deep-link target and gives an in-page nav (or a
    save-blocker) something to point at.
--}}
@props([
    'title' => 'Shipping',
    'hint' => null,
    'id' => null,
    'moreLabel' => null,
    'moreHref' => null,
])

@php
    // `null` (absent) renders the sample sentence so the docs preview reads as
    // a real section; pass `:hint="false"` for a section with no hint at all.
    $hint ??= __('Where this order ships and which carrier service it was booked with.');
@endphp

<section
    @if ($id !== null) id="{{ $id }}" @endif
    data-slot="record-section"
    data-surface="admin"
    {{ $attributes->merge(['class' => 'min-w-0']) }}
>
    <x-ui.card class="p-6">
        <div class="flex min-w-0 flex-wrap items-baseline justify-between gap-x-4 gap-y-2">
            <h2 data-slot="record-section-title" class="text-xs font-semibold tracking-wide uppercase">{{ $title }}</h2>

            @isset($aside)
                <div data-slot="record-section-aside" class="min-w-0 text-xs">{{ $aside }}</div>
            @elseif ($moreHref !== null)
                <div data-slot="record-section-aside" class="min-w-0 text-xs">
                    <x-ui.button variant="link" size="sm" :href="$moreHref" class="text-xs">
                        {{ $moreLabel ?? __('View details') }}
                    </x-ui.button>
                </div>
            @endisset
        </div>

        @if ($hint)
            <p data-slot="record-section-hint" class="mt-2 max-w-prose text-xs leading-4 text-pretty text-muted-foreground">{{ $hint }}</p>
        @endif

        <div data-slot="record-section-body" class="mt-4 min-w-0">
            @if (trim($slot) !== '')
                {{ $slot }}
            @else
                <x-ui.fact-list :facts="[
                    ['label' => __('Address'), 'value' => 'Keizersgracht 12, 1015 CN Amsterdam'],
                    ['label' => __('Carrier'), 'value' => 'PostNL — Standard'],
                    ['label' => __('Tracking'), 'value' => '3SABCD1234567', 'mono' => true],
                ]" />
            @endif
        </div>
    </x-ui.card>
</section>

Ownership & lifecycle

Owner, release state, review evidence and adoption for this item.
Owner
Platform UI (@JoshJML)
Current version
1.0.1
Status
Stable
License
open
Accessibility reviewed
No review date recorded
Last breaking change
No date recorded
Deprecation
Not deprecated
Contract
v6
Foundation
≥ 1.0.0