Skip to content
Brok UI

Loading…

No results

Order Summary

Open source

Order confirmation cards — a success state with line items, totals, shipping address and tracking actions.

Preview

resources/views/blocks/order-summary-receipt.blade.php Blade
@props([
    'orderNumber'  => 'ORD-84921',
    'orderDate'    => 'June 14, 2026',
    'brandName'    => 'Acme Store',
    'currency'     => '$',
    'billTo'       => null,
    'shipTo'       => null,
    'items'        => null,
    'subtotal'     => '202.98',
    'discount'     => '20.30',
    'shipping'     => '0.00',
    'tax'          => '18.27',
    'total'        => '200.95',
    'paymentLast4' => '4242',
    'paymentBrand' => 'Visa',
    'downloadHref' => '#',
    'printHref'    => '#',
])

@php
    $billTo ??= ['name' => 'Jane Doe', 'lines' => ['42 Maple Avenue', 'Austin, TX 78701', 'United States'], 'email' => 'jane.doe@example.com'];
    $shipTo ??= ['name' => 'Jane Doe', 'lines' => ['42 Maple Avenue', 'Austin, TX 78701', 'United States']];
    $items ??= [
        ['description' => 'Wireless Noise-Cancelling Headphones', 'qty' => 1, 'unitPrice' => '149.00'],
        ['description' => 'USB-C Charging Cable (2 m)', 'qty' => 2, 'unitPrice' => '14.99'],
        ['description' => 'Carry Pouch — Charcoal', 'qty' => 1, 'unitPrice' => '24.00'],
    ];
    $metaRows = [
        [__('Subtotal'), $currency.$subtotal],
        [__('Discount'), '− '.$currency.$discount],
        [__('Shipping'), $shipping === '0.00' ? __('Free') : $currency.$shipping],
        [__('Tax'), $currency.$tax],
    ];
@endphp

<x-ui.section space="md" {{ $attributes }}>
    <x-ui.container size="sm" gutter="sm">
        <x-ui.card>
            <x-ui.card.header class="flex flex-row items-start justify-between gap-4">
                <div class="flex items-center gap-2">
                    <svg viewBox="0 0 24 24" fill="currentColor" class="size-7 text-primary" aria-hidden="true"><path d="M12 2 2 7l10 5 10-5-10-5ZM2 17l10 5 10-5M2 12l10 5 10-5" /></svg>
                    <span class="text-lg font-bold tracking-tight">{{ $brandName }}</span>
                </div>
                <div class="flex flex-col items-end gap-2 text-end">
                    <div class="flex items-center gap-2"><span class="text-xl font-semibold">{{ __('Receipt') }}</span><x-ui.badge variant="success" size="sm">{{ __('Paid') }}</x-ui.badge></div>
                    <p class="text-sm text-muted-foreground">{{ __('Order') }} <span class="font-mono font-medium text-foreground">{{ $orderNumber }}</span></p>
                    <p class="text-sm text-muted-foreground">{{ $orderDate }}</p>
                </div>
            </x-ui.card.header>

            <x-ui.card.content class="space-y-6">
                <div class="grid grid-cols-2 gap-6 rounded-lg bg-muted/40 p-6">
                    <address class="space-y-0.5 text-sm not-italic">
                        <p class="mb-2 text-sm font-semibold uppercase tracking-widest text-muted-foreground">{{ __('Billed to') }}</p>
                        <p class="font-medium">{{ $billTo['name'] }}</p>
                        @foreach ($billTo['lines'] as $line)<p class="text-muted-foreground">{{ $line }}</p>@endforeach
                        @if (! empty($billTo['email']))<p class="text-muted-foreground">{{ $billTo['email'] }}</p>@endif
                    </address>
                    <address class="space-y-0.5 text-sm not-italic">
                        <p class="mb-2 text-sm font-semibold uppercase tracking-widest text-muted-foreground">{{ __('Ship to') }}</p>
                        <p class="font-medium">{{ $shipTo['name'] }}</p>
                        @foreach ($shipTo['lines'] as $line)<p class="text-muted-foreground">{{ $line }}</p>@endforeach
                    </address>
                </div>

                <x-ui.separator />

                <x-ui.table>
                    <caption class="sr-only">{{ __('Invoice line items') }}</caption>
                    <x-ui.table.header>
                        <x-ui.table.row class="hover:bg-transparent">
                            <x-ui.table.head scope="col" class="ps-0">{{ __('Description') }}</x-ui.table.head>
                            <x-ui.table.head scope="col" align="center">{{ __('Qty') }}</x-ui.table.head>
                            <x-ui.table.head scope="col" align="end">{{ __('Unit') }}</x-ui.table.head>
                            <x-ui.table.head scope="col" align="end" class="pe-0">{{ __('Total') }}</x-ui.table.head>
                        </x-ui.table.row>
                    </x-ui.table.header>
                    <x-ui.table.body>
                        @foreach ($items as $item)
                            <x-ui.table.row class="hover:bg-transparent">
                                <x-ui.table.cell class="ps-0 font-medium">{{ $item['description'] }}</x-ui.table.cell>
                                <x-ui.table.cell align="center" class="text-muted-foreground">{{ $item['qty'] }}</x-ui.table.cell>
                                <x-ui.table.cell align="end" class="tabular-nums text-muted-foreground">{{ $currency }}{{ $item['unitPrice'] }}</x-ui.table.cell>
                                <x-ui.table.cell align="end" class="pe-0 font-medium tabular-nums">{{ $currency }}{{ number_format((float) $item['unitPrice'] * (int) $item['qty'], 2) }}</x-ui.table.cell>
                            </x-ui.table.row>
                        @endforeach
                    </x-ui.table.body>
                </x-ui.table>

                <div class="ms-auto w-full max-w-xs space-y-2 text-sm">
                    @foreach ($metaRows as [$label, $value])
                        <div class="flex items-center justify-between gap-4"><span class="text-muted-foreground">{{ $label }}</span><span class="tabular-nums">{{ $value }}</span></div>
                    @endforeach
                    <x-ui.separator class="my-2" />
                    <div class="flex items-center justify-between gap-4"><span class="font-semibold">{{ __('Total paid') }}</span><span class="text-lg font-bold tabular-nums">{{ $currency }}{{ $total }}</span></div>
                </div>

                <x-ui.separator />

                <div class="flex items-center gap-4 text-sm">
                    <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="size-5 text-muted-foreground" aria-hidden="true"><rect x="2" y="5" width="20" height="14" rx="2" /><path d="M2 10h20" /></svg>
                    <span class="text-muted-foreground">{{ __('Payment') }}</span>
                    <span class="font-medium">{{ $paymentBrand }} <span class="font-mono tracking-widest">•••• {{ $paymentLast4 }}</span></span>
                </div>
            </x-ui.card.content>

            <x-ui.card.footer class="flex flex-col gap-4 pt-2">
                <div class="flex w-full flex-wrap items-center gap-4">
                    <x-ui.button variant="outline" size="sm" :href="$downloadHref">
                        <x-slot:icon><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="size-4" aria-hidden="true"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" /><polyline points="7 10 12 15 17 10" /><line x1="12" y1="15" x2="12" y2="3" /></svg></x-slot:icon>
                        {{ __('Download PDF') }}
                    </x-ui.button>
                    <x-ui.button variant="ghost" size="sm" :href="$printHref">
                        <x-slot:icon><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="size-4" aria-hidden="true"><polyline points="6 9 6 2 18 2 18 9" /><path d="M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2" /><rect x="6" y="14" width="12" height="8" /></svg></x-slot:icon>
                        {{ __('Print') }}
                    </x-ui.button>
                </div>
                <p class="text-sm text-muted-foreground">{{ __('Thank you for your order! If you have any questions, please contact our support team.') }}</p>
            </x-ui.card.footer>
        </x-ui.card>
    </x-ui.container>
</x-ui.section>

Installation

terminal
php artisan ui:add blocks/order-summary-receipt

Registry contract

Install confidence

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

Registry dependencies

badge button card container section separator table

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.

order-summary-receipt.md
# Brok UI block: Order Receipt (`order-summary-receipt`)

A printable order receipt/invoice card with billing and shipping addresses, itemised lines, totals, payment method and download/print actions.

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/order-summary-receipt
```

## Render it

```blade
<x-blocks.order-summary-receipt />
```

## Props

- `order-number` (string, default `ORD-84921`) — Order number shown in the receipt header.
- `order-date` (string, default `June 14, 2026`) — Order date shown under the order number.
- `brand-name` (string, default `Acme Store`) — Store/brand name shown beside the logo mark.
- `currency` (string, default `$`) — Currency symbol prefixed to each price.
- `bill-to` (mixed|null, default `null`) — Billing address ({name, lines, email}); null falls back to a sample address.
- `ship-to` (mixed|null, default `null`) — Shipping address ({name, lines}); null falls back to a sample address.
- `items` (mixed|null, default `null`) — Array of invoice line items ({description, qty, unitPrice}); null falls back to sample items.
- `subtotal` (string, default `202.98`) — Subtotal amount before discount, shipping and tax.
- `discount` (string, default `20.30`) — Discount amount subtracted from the subtotal.
- `shipping` (string, default `0.00`) — Shipping cost line; '0.00' renders as Free.
- `tax` (string, default `18.27`) — Tax amount line in the totals summary.
- `total` (string, default `200.95`) — Grand total shown as Total paid.
- `payment-last4` (string, default `4242`) — Last four digits of the card used for payment.
- `payment-brand` (string, default `Visa`) — Card brand name shown beside the masked number.
- `download-href` (string, default `#`) — Destination for the download-PDF action.
- `print-href` (string, default `#`) — Destination for the print action.

## Use when

- Producing a printable receipt/invoice with billing and shipping addresses, an itemised table and a totals summary.
- Offering download-PDF and print actions alongside the payment method used for the order.

## Avoid when

- Showing a lightweight post-checkout confirmation right after purchase; use order-summary-confirmation instead.

## Rules

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

  • Producing a printable receipt/invoice with billing and shipping addresses, an itemised table and a totals summary.
  • Offering download-PDF and print actions alongside the payment method used for the order.

Avoid when

  • Showing a lightweight post-checkout confirmation right after purchase; use order-summary-confirmation instead.

Anti-patterns

  • Do not replace semantic props with conflicting utility classes.
  • Do not remove labels, focus styles, or state attributes.
Anatomy
card header with brand and receipt badge billing/shipping addresses itemized table totals summary payment method line download/print actions

Usage

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

resources/views/welcome.blade.php Blade
<x-blocks.order-summary-receipt />

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/order-summary-receipt.blade.php Blade
@props([
    'orderNumber'  => 'ORD-84921',
    'orderDate'    => 'June 14, 2026',
    'brandName'    => 'Acme Store',
    'currency'     => '$',
    'billTo'       => null,
    'shipTo'       => null,
    'items'        => null,
    'subtotal'     => '202.98',
    'discount'     => '20.30',
    'shipping'     => '0.00',
    'tax'          => '18.27',
    'total'        => '200.95',
    'paymentLast4' => '4242',
    'paymentBrand' => 'Visa',
    'downloadHref' => '#',
    'printHref'    => '#',
])

@php
    $billTo ??= ['name' => 'Jane Doe', 'lines' => ['42 Maple Avenue', 'Austin, TX 78701', 'United States'], 'email' => 'jane.doe@example.com'];
    $shipTo ??= ['name' => 'Jane Doe', 'lines' => ['42 Maple Avenue', 'Austin, TX 78701', 'United States']];
    $items ??= [
        ['description' => 'Wireless Noise-Cancelling Headphones', 'qty' => 1, 'unitPrice' => '149.00'],
        ['description' => 'USB-C Charging Cable (2 m)', 'qty' => 2, 'unitPrice' => '14.99'],
        ['description' => 'Carry Pouch — Charcoal', 'qty' => 1, 'unitPrice' => '24.00'],
    ];
    $metaRows = [
        [__('Subtotal'), $currency.$subtotal],
        [__('Discount'), '− '.$currency.$discount],
        [__('Shipping'), $shipping === '0.00' ? __('Free') : $currency.$shipping],
        [__('Tax'), $currency.$tax],
    ];
@endphp

<x-ui.section space="md" {{ $attributes }}>
    <x-ui.container size="sm" gutter="sm">
        <x-ui.card>
            <x-ui.card.header class="flex flex-row items-start justify-between gap-4">
                <div class="flex items-center gap-2">
                    <svg viewBox="0 0 24 24" fill="currentColor" class="size-7 text-primary" aria-hidden="true"><path d="M12 2 2 7l10 5 10-5-10-5ZM2 17l10 5 10-5M2 12l10 5 10-5" /></svg>
                    <span class="text-lg font-bold tracking-tight">{{ $brandName }}</span>
                </div>
                <div class="flex flex-col items-end gap-2 text-end">
                    <div class="flex items-center gap-2"><span class="text-xl font-semibold">{{ __('Receipt') }}</span><x-ui.badge variant="success" size="sm">{{ __('Paid') }}</x-ui.badge></div>
                    <p class="text-sm text-muted-foreground">{{ __('Order') }} <span class="font-mono font-medium text-foreground">{{ $orderNumber }}</span></p>
                    <p class="text-sm text-muted-foreground">{{ $orderDate }}</p>
                </div>
            </x-ui.card.header>

            <x-ui.card.content class="space-y-6">
                <div class="grid grid-cols-2 gap-6 rounded-lg bg-muted/40 p-6">
                    <address class="space-y-0.5 text-sm not-italic">
                        <p class="mb-2 text-sm font-semibold uppercase tracking-widest text-muted-foreground">{{ __('Billed to') }}</p>
                        <p class="font-medium">{{ $billTo['name'] }}</p>
                        @foreach ($billTo['lines'] as $line)<p class="text-muted-foreground">{{ $line }}</p>@endforeach
                        @if (! empty($billTo['email']))<p class="text-muted-foreground">{{ $billTo['email'] }}</p>@endif
                    </address>
                    <address class="space-y-0.5 text-sm not-italic">
                        <p class="mb-2 text-sm font-semibold uppercase tracking-widest text-muted-foreground">{{ __('Ship to') }}</p>
                        <p class="font-medium">{{ $shipTo['name'] }}</p>
                        @foreach ($shipTo['lines'] as $line)<p class="text-muted-foreground">{{ $line }}</p>@endforeach
                    </address>
                </div>

                <x-ui.separator />

                <x-ui.table>
                    <caption class="sr-only">{{ __('Invoice line items') }}</caption>
                    <x-ui.table.header>
                        <x-ui.table.row class="hover:bg-transparent">
                            <x-ui.table.head scope="col" class="ps-0">{{ __('Description') }}</x-ui.table.head>
                            <x-ui.table.head scope="col" align="center">{{ __('Qty') }}</x-ui.table.head>
                            <x-ui.table.head scope="col" align="end">{{ __('Unit') }}</x-ui.table.head>
                            <x-ui.table.head scope="col" align="end" class="pe-0">{{ __('Total') }}</x-ui.table.head>
                        </x-ui.table.row>
                    </x-ui.table.header>
                    <x-ui.table.body>
                        @foreach ($items as $item)
                            <x-ui.table.row class="hover:bg-transparent">
                                <x-ui.table.cell class="ps-0 font-medium">{{ $item['description'] }}</x-ui.table.cell>
                                <x-ui.table.cell align="center" class="text-muted-foreground">{{ $item['qty'] }}</x-ui.table.cell>
                                <x-ui.table.cell align="end" class="tabular-nums text-muted-foreground">{{ $currency }}{{ $item['unitPrice'] }}</x-ui.table.cell>
                                <x-ui.table.cell align="end" class="pe-0 font-medium tabular-nums">{{ $currency }}{{ number_format((float) $item['unitPrice'] * (int) $item['qty'], 2) }}</x-ui.table.cell>
                            </x-ui.table.row>
                        @endforeach
                    </x-ui.table.body>
                </x-ui.table>

                <div class="ms-auto w-full max-w-xs space-y-2 text-sm">
                    @foreach ($metaRows as [$label, $value])
                        <div class="flex items-center justify-between gap-4"><span class="text-muted-foreground">{{ $label }}</span><span class="tabular-nums">{{ $value }}</span></div>
                    @endforeach
                    <x-ui.separator class="my-2" />
                    <div class="flex items-center justify-between gap-4"><span class="font-semibold">{{ __('Total paid') }}</span><span class="text-lg font-bold tabular-nums">{{ $currency }}{{ $total }}</span></div>
                </div>

                <x-ui.separator />

                <div class="flex items-center gap-4 text-sm">
                    <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="size-5 text-muted-foreground" aria-hidden="true"><rect x="2" y="5" width="20" height="14" rx="2" /><path d="M2 10h20" /></svg>
                    <span class="text-muted-foreground">{{ __('Payment') }}</span>
                    <span class="font-medium">{{ $paymentBrand }} <span class="font-mono tracking-widest">•••• {{ $paymentLast4 }}</span></span>
                </div>
            </x-ui.card.content>

            <x-ui.card.footer class="flex flex-col gap-4 pt-2">
                <div class="flex w-full flex-wrap items-center gap-4">
                    <x-ui.button variant="outline" size="sm" :href="$downloadHref">
                        <x-slot:icon><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="size-4" aria-hidden="true"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" /><polyline points="7 10 12 15 17 10" /><line x1="12" y1="15" x2="12" y2="3" /></svg></x-slot:icon>
                        {{ __('Download PDF') }}
                    </x-ui.button>
                    <x-ui.button variant="ghost" size="sm" :href="$printHref">
                        <x-slot:icon><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="size-4" aria-hidden="true"><polyline points="6 9 6 2 18 2 18 9" /><path d="M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2" /><rect x="6" y="14" width="12" height="8" /></svg></x-slot:icon>
                        {{ __('Print') }}
                    </x-ui.button>
                </div>
                <p class="text-sm text-muted-foreground">{{ __('Thank you for your order! If you have any questions, please contact our support team.') }}</p>
            </x-ui.card.footer>
        </x-ui.card>
    </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.1.2
Status
Stable
License
open
Deprecation
Not deprecated
Contract
v1
Foundation
≥ 1.0.0