Skip to content
Brok UI

Loading…

No results

Summary Card

Open source

Card with bulleted key points and a row of source link chips, headed by an optional decorative sparkle.

Version
v2.0.4
Stability
stable
License
MIT
Related
Card
Hover Card
Link Preview

Preview

Summary

  • The proposal cuts onboarding time by automating the first three setup steps.
  • Most friction came from manual API-key entry, now handled inline.
  • Rollout is staged behind a flag with a one-click revert path.
Sources spec.md rollout-plan
previews.components.summary-card.default.blade.php Blade
<x-ui.summary-card class="mx-auto w-full max-w-lg" />

Installation

terminal
php artisan ui:add summary-card

Registry contract

php artisan ui:add summary-card 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/summary-card.blade.php
Registry dependencies
badge
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.

summary-card.md
# Brok UI: Summary Card (`summary-card`)

Card with bulleted key points and a row of source link chips, headed by an optional decorative sparkle.

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

## Install

```bash
php artisan ui:add summary-card
```

## Usage

```blade
<x-ui.summary-card class="mx-auto w-full max-w-lg" />
```

## Props

- `title` (string, default `Summary`)
- `points` (array, default `[…]`)
- `sources` (array, default `[…]`)

## Use when

- Use when self-contained content objects benefit from a recognizable card-like presentation with local actions or metadata.
- Summarising a document, thread or answer as a few key points with the sources they came from.
- Closing an AI response with the citations it relied on, as clickable chips.

## Avoid when

- Do not use card widgets where a simpler list, table, or plain text block would make comparison faster.
- Presenting a single citation inline; citation is the inline primitive.
- Listing arbitrary items; card with a list is the general shape.

## Anti-patterns

- Using cards for dense cross-item comparison

## Rules

- Use the `<brok:summary-card>` tag (or `<x-ui.summary-card>`) 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/summary-card
- Registry JSON (files, props, contract): https://brokui.dev/r/open/summary-card.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 Summary
points array […]
sources array […]

Slots

  • default —

Data slots

Stable hooks for CSS overrides and browser tests.

summary-card

Behavior

  • points render as a bulleted list under the title; sources render as outline badge chips.
  • A source with an href renders as a link chip, one without stays a plain muted chip.
  • The sparkle heading glyph is decorative and can be omitted.
  • Declares registry capability flags: a11y, responsive, rtl, darkMode, localized.

Guidance

Card and content widget

Present a self-contained content object with local context.

Use when

  • Use when self-contained content objects benefit from a recognizable card-like presentation with local actions or metadata.
  • Summarising a document, thread or answer as a few key points with the sources they came from.
  • Closing an AI response with the citations it relied on, as clickable chips.

Avoid when

  • Do not use card widgets where a simpler list, table, or plain text block would make comparison faster.
  • Presenting a single citation inline; citation is the inline primitive.
  • Listing arbitrary items; card with a list is the general shape.

Use instead

  • List for compact scanning
  • Table for exact comparison

Anti-patterns

  • Using cards for dense cross-item comparison
Anatomy
root
Theming hooks
summary-card

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
  • Source chips with a destination are real links with a visible focus ring; the sparkle is aria-hidden.
  • Key points are a real list, so a screen reader announces the count and each item.
  • 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/summary-card.blade.php Blade
@props([
    'title' => 'Summary',
    'points' => [
        'The proposal cuts onboarding time by automating the first three setup steps.',
        'Most friction came from manual API-key entry, now handled inline.',
        'Rollout is staged behind a flag with a one-click revert path.',
    ],
    'sources' => [
        ['label' => 'spec.md', 'href' => null],
        ['label' => 'rollout-plan', 'href' => '#'],
    ],
])

@php
    $points = is_array($points) ? $points : [];
    $sources = is_array($sources) ? $sources : [];
@endphp

{{--
    Summary card — a sparkle-headed card. The heading pairs a decorative
    (aria-hidden) sparkle glyph with the localized title; key points render as a
    bulleted list; sources render as small chips that become links only when an
    `href` is present (otherwise a plain span), so empty sources never produce a
    dead anchor.
--}}
<div
    data-slot="summary-card"
    {{ $attributes->merge(['class' => 'rounded-lg border border-border bg-card p-6 text-foreground']) }}
>
    <div class="flex items-center gap-2">
        <svg aria-hidden="true" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" class="size-5 shrink-0 text-muted-foreground">
            <path d="M12 3l1.6 4.4L18 9l-4.4 1.6L12 15l-1.6-4.4L6 9l4.4-1.6L12 3Z" />
            <path d="M19 14l.7 1.9L21.6 16.6 19.7 17.3 19 19.2 18.3 17.3 16.4 16.6 18.3 15.9 19 14Z" />
        </svg>
        <h3 class="text-sm font-semibold">{{ __($title) }}</h3>
    </div>

    {{-- Each point's text starts where the title does (glyph column + gap);
         the marker is a small muted dot centred on the first line. --}}
    <ul class="mt-3 space-y-2 text-sm leading-5 text-foreground">
        @foreach ($points as $point)
            <li class="flex gap-2">
                <span class="flex h-5 w-5 shrink-0 items-center justify-center" aria-hidden="true"><span class="size-1 rounded-full bg-muted-foreground"></span></span>
                <span class="min-w-0">{{ $point }}</span>
            </li>
        @endforeach
    </ul>

    @if (count($sources))
        <div class="mt-4 flex flex-wrap items-center gap-2 border-t border-border pt-4 text-xs">
            <span class="text-muted-foreground">{{ __('Sources') }}</span>
            @foreach ($sources as $source)
                @php
                    $label = $source['label'] ?? '';
                    $href = $source['href'] ?? null;
                @endphp
                @if ($href)
                    <x-ui.badge as="a" :href="$href" variant="outline" size="sm" class="hover:bg-accent focus-visible:outline-none focus-visible:ring-[length:var(--ring-width)] focus-visible:ring-ring">{{ $label }}</x-ui.badge>
                @else
                    <x-ui.badge variant="outline" size="sm" class="text-muted-foreground">{{ $label }}</x-ui.badge>
                @endif
            @endforeach
        </div>
    @endif
</div>

Ownership & lifecycle

Owner, release state, review evidence and adoption for this item.
Owner
Platform UI (@JoshJML)
Current version
2.0.4
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