Skip to content
Brok UI

Loading…

No results

Checkout

Open source

Checkout pages — a contact/shipping/payment form beside a sticky order-summary card with promo code and totals.

Preview

resources/views/blocks/checkout-two-column.blade.php Blade
@props([
    'heading' => 'Checkout',
    'subheading' => 'Complete your order in a few quick steps.',
    'action' => '#',
    'items' => null,
    'deliveryOptions' => null,
    'currency' => '$',
    'subtotal' => '236.00',
    'shipping' => '12.00',
    'tax' => '19.84',
    'total' => '267.84',
])

@php
    $items ??= [
        [
            'name' => 'Aerolight Running Shoes',
            'variant' => 'Slate / US 10',
            'qty' => 1,
            'price' => '128.00',
            'initials' => 'AR',
        ],
        [
            'name' => 'Merino Crew Socks (3-pack)',
            'variant' => 'Charcoal',
            'qty' => 2,
            'price' => '54.00',
            'initials' => 'MS',
        ],
    ];

    $deliveryOptions ??= [
        [
            'value' => 'standard',
            'label' => 'Standard',
            'detail' => '4–6 business days',
            'price' => '12.00',
            'checked' => true,
        ],
        [
            'value' => 'express',
            'label' => 'Express',
            'detail' => '2–3 business days',
            'price' => '24.00',
            'checked' => false,
        ],
        [
            'value' => 'overnight',
            'label' => 'Overnight',
            'detail' => 'Next business day',
            'price' => '38.00',
            'checked' => false,
        ],
    ];
@endphp

<x-ui.section space="lg" {{ $attributes }}>
    <x-ui.container gutter="sm">
        <header class="mx-auto max-w-2xl">
            <h1 class="text-3xl font-bold tracking-tight sm:text-4xl">{{ __($heading) }}</h1>
            @if ($subheading)
                <p class="mt-2 text-pretty text-muted-foreground">{{ __($subheading) }}</p>
            @endif
        </header>

        <form method="POST" action="{{ $action }}" class="mt-10 grid grid-cols-1 gap-10 lg:grid-cols-3 lg:items-start">
            @csrf

            {{-- Left column: form sections --}}
            <div class="space-y-10 lg:col-span-2">

                {{-- Contact --}}
                <fieldset class="space-y-4">
                    <legend class="text-lg font-semibold tracking-tight">{{ __('Contact') }}</legend>
                    <x-ui.field>
                        <x-ui.label for="checkout-email" required>{{ __('Email address') }}</x-ui.label>
                        <x-ui.input
                            id="checkout-email"
                            type="email"
                            name="email"
                            autocomplete="email"
                            required
                            placeholder="{{ __('you@example.com') }}"
                        />
                        <p class="text-sm text-muted-foreground">{{ __('Order confirmation and receipts are sent here.') }}</p>
                    </x-ui.field>
                </fieldset>

                {{-- Shipping address --}}
                <fieldset class="space-y-4">
                    <legend class="text-lg font-semibold tracking-tight">{{ __('Shipping address') }}</legend>

                    <div class="grid grid-cols-1 gap-4 sm:grid-cols-2">
                        <x-ui.field>
                            <x-ui.label for="checkout-first-name" required>{{ __('First name') }}</x-ui.label>
                            <x-ui.input id="checkout-first-name" name="first_name" autocomplete="given-name" required placeholder="{{ __('Jane') }}" />
                        </x-ui.field>
                        <x-ui.field>
                            <x-ui.label for="checkout-last-name" required>{{ __('Last name') }}</x-ui.label>
                            <x-ui.input id="checkout-last-name" name="last_name" autocomplete="family-name" required placeholder="{{ __('Doe') }}" />
                        </x-ui.field>
                    </div>

                    <x-ui.field>
                        <x-ui.label for="checkout-address" required>{{ __('Street address') }}</x-ui.label>
                        <x-ui.input id="checkout-address" name="address" autocomplete="street-address" required placeholder="{{ __('123 Market Street') }}" />
                    </x-ui.field>

                    <x-ui.field>
                        <x-ui.label for="checkout-apartment">{{ __('Apartment, suite, etc.') }}</x-ui.label>
                        <x-ui.input id="checkout-apartment" name="apartment" autocomplete="address-line2" placeholder="{{ __('Optional') }}" />
                    </x-ui.field>

                    <div class="grid grid-cols-1 gap-4 sm:grid-cols-6">
                        <div class="sm:col-span-3">
                            <x-ui.field>
                                <x-ui.label for="checkout-city" required>{{ __('City') }}</x-ui.label>
                                <x-ui.input id="checkout-city" name="city" autocomplete="address-level2" required placeholder="{{ __('San Francisco') }}" />
                            </x-ui.field>
                        </div>
                        <div class="sm:col-span-2">
                            <x-ui.field>
                                <x-ui.label for="checkout-state" required>{{ __('State') }}</x-ui.label>
                                <x-ui.input id="checkout-state" name="state" autocomplete="address-level1" required placeholder="{{ __('CA') }}" />
                            </x-ui.field>
                        </div>
                        <div class="sm:col-span-1">
                            <x-ui.field>
                                <x-ui.label for="checkout-zip" required>{{ __('ZIP') }}</x-ui.label>
                                <x-ui.input id="checkout-zip" name="postal_code" inputmode="numeric" autocomplete="postal-code" required placeholder="{{ __('94103') }}" />
                            </x-ui.field>
                        </div>
                    </div>

                    <x-ui.field>
                        <x-ui.label for="checkout-phone">{{ __('Phone') }}</x-ui.label>
                        <x-ui.input id="checkout-phone" type="tel" name="phone" autocomplete="tel" placeholder="{{ __('+1 (555) 000-0000') }}" />
                    </x-ui.field>
                </fieldset>

                {{-- Delivery method --}}
                <fieldset class="space-y-4">
                    <legend class="text-lg font-semibold tracking-tight">{{ __('Delivery method') }}</legend>

                    <div class="grid grid-cols-1 gap-4 sm:grid-cols-3">
                        @foreach ($deliveryOptions as $option)
                            <label
                                for="delivery-{{ $option['value'] }}"
                                class="flex cursor-pointer items-start gap-4 rounded-lg border border-input bg-card p-6 transition-colors hover:bg-accent has-[:checked]:border-primary has-[:checked]:ring-1 has-[:checked]:ring-ring has-[:focus-visible]:ring-2"
                            >
                                <x-ui.radio
                                    id="delivery-{{ $option['value'] }}"
                                    name="delivery_method"
                                    value="{{ $option['value'] }}"
                                    class="mt-0.5"
                                    :checked="$option['checked']"
                                />
                                <span class="min-w-0 flex-1">
                                    <span class="block text-sm font-medium text-foreground">{{ __($option['label']) }}</span>
                                    <span class="block text-sm text-muted-foreground">{{ __($option['detail']) }}</span>
                                    <span class="mt-2 block text-sm font-semibold text-foreground">{{ $currency }}{{ $option['price'] }}</span>
                                </span>
                            </label>
                        @endforeach
                    </div>
                </fieldset>

                {{-- Payment --}}
                <fieldset class="space-y-4">
                    <legend class="text-lg font-semibold tracking-tight">{{ __('Payment') }}</legend>

                    <label
                        for="payment-card"
                        class="flex cursor-pointer items-center gap-4 rounded-lg border border-input bg-card p-6 transition-colors hover:bg-accent has-[:checked]:border-primary has-[:checked]:ring-1 has-[:checked]:ring-ring"
                    >
                        <x-ui.radio id="payment-card" name="payment_method" value="card" checked />
                        <span class="flex flex-1 items-center justify-between">
                            <span class="text-sm font-medium text-foreground">{{ __('Credit or debit card') }}</span>
                            <svg class="size-6 text-muted-foreground" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
                                <rect x="2" y="5" width="20" height="14" rx="2" />
                                <path d="M2 10h20" />
                            </svg>
                        </span>
                    </label>

                    <x-ui.field>
                        <x-ui.label for="checkout-card-number" required>{{ __('Card number') }}</x-ui.label>
                        <x-ui.input
                            id="checkout-card-number"
                            name="card_number"
                            inputmode="numeric"
                            autocomplete="cc-number"
                            required
                            placeholder="{{ __('1234 1234 1234 1234') }}"
                        />
                    </x-ui.field>

                    <div class="grid grid-cols-1 gap-4 sm:grid-cols-3">
                        <div class="sm:col-span-1">
                            <x-ui.field>
                                <x-ui.label for="checkout-card-name" required>{{ __('Name on card') }}</x-ui.label>
                                <x-ui.input id="checkout-card-name" name="card_name" autocomplete="cc-name" required placeholder="{{ __('Jane Doe') }}" />
                            </x-ui.field>
                        </div>
                        <div class="sm:col-span-1">
                            <x-ui.field>
                                <x-ui.label for="checkout-card-expiry" required>{{ __('Expiry') }}</x-ui.label>
                                <x-ui.input id="checkout-card-expiry" name="card_expiry" inputmode="numeric" autocomplete="cc-exp" required placeholder="{{ __('MM / YY') }}" />
                            </x-ui.field>
                        </div>
                        <div class="sm:col-span-1">
                            <x-ui.field>
                                <x-ui.label for="checkout-card-cvc" required>{{ __('CVC') }}</x-ui.label>
                                <x-ui.input id="checkout-card-cvc" name="card_cvc" inputmode="numeric" autocomplete="cc-csc" required placeholder="{{ __('123') }}" />
                            </x-ui.field>
                        </div>
                    </div>
                </fieldset>
            </div>

            {{-- Right column: sticky order summary --}}
            <aside class="lg:sticky lg:top-8" aria-labelledby="checkout-summary-title">
                <x-ui.card class="p-6">
                    <h2 id="checkout-summary-title" class="text-lg font-semibold tracking-tight">{{ __('Order summary') }}</h2>

                    <ul role="list" class="mt-6 space-y-4">
                        @foreach ($items as $item)
                            <li class="flex items-start gap-4">
                                <span
                                    class="flex size-14 shrink-0 items-center justify-center rounded-md bg-muted text-sm font-semibold text-muted-foreground"
                                    aria-hidden="true"
                                >
                                    {{ $item['initials'] }}
                                </span>
                                <div class="min-w-0 flex-1">
                                    <p class="truncate text-sm font-medium text-foreground">{{ __($item['name']) }}</p>
                                    <p class="truncate text-sm text-muted-foreground">{{ __($item['variant']) }}</p>
                                    <p class="text-sm text-muted-foreground">{{ __('Qty') }} {{ $item['qty'] }}</p>
                                </div>
                                <p class="shrink-0 text-sm font-medium text-foreground">{{ $currency }}{{ $item['price'] }}</p>
                            </li>
                        @endforeach
                    </ul>

                    <x-ui.separator class="my-6" />

                    <div class="space-y-2">
                        <x-ui.label for="checkout-promo">{{ __('Promo code') }}</x-ui.label>
                        <div class="flex items-stretch gap-2">
                            <x-ui.input
                                id="checkout-promo"
                                name="promo_code"
                                autocomplete="off"
                                class="flex-1"
                                placeholder="{{ __('Enter code') }}"
                            />
                            <x-ui.button type="submit" name="intent" value="apply_promo" variant="outline">
                                {{ __('Apply') }}
                            </x-ui.button>
                        </div>
                    </div>

                    <x-ui.separator class="my-6" />

                    <div class="space-y-4 text-sm">
                        <div class="flex items-center justify-between">
                            <span class="text-muted-foreground">{{ __('Subtotal') }}</span>
                            <span class="font-medium text-foreground">{{ $currency }}{{ $subtotal }}</span>
                        </div>
                        <div class="flex items-center justify-between">
                            <span class="text-muted-foreground">{{ __('Shipping') }}</span>
                            <span class="font-medium text-foreground">{{ $currency }}{{ $shipping }}</span>
                        </div>
                        <div class="flex items-center justify-between">
                            <span class="text-muted-foreground">{{ __('Tax') }}</span>
                            <span class="font-medium text-foreground">{{ $currency }}{{ $tax }}</span>
                        </div>

                        <x-ui.separator class="my-2" />

                        <div class="flex items-center justify-between text-sm">
                            <span class="font-semibold text-foreground">{{ __('Total') }}</span>
                            <span class="font-semibold text-foreground">{{ $currency }}{{ $total }}</span>
                        </div>
                    </div>

                    <x-ui.button type="submit" name="intent" value="place_order" class="mt-6 w-full">
                        <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">
                            <rect x="5" y="11" width="14" height="10" rx="2" />
                            <path d="M8 11V7a4 4 0 0 1 8 0v4" />
                        </svg>
                        {{ __('Place order') }}
                    </x-ui.button>

                    <p class="mt-4 flex items-center justify-center gap-2 text-sm text-muted-foreground">
                        <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">
                            <rect x="5" y="11" width="14" height="10" rx="2" />
                            <path d="M8 11V7a4 4 0 0 1 8 0v4" />
                        </svg>
                        {{ __('Secured with 256-bit SSL encryption.') }}
                    </p>
                </x-ui.card>
            </aside>
        </form>
    </x-ui.container>
</x-ui.section>

Installation

terminal
php artisan ui:add blocks/checkout-two-column

Registry contract

Install confidence

php artisan ui:add blocks/checkout-two-column 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.4
License
open
Stability
stable
Contract
v1
Foundation
≥ 1.0.0
Type Generated target
blade resources/views/blocks/checkout-two-column.blade.php

Registry dependencies

button card container field input label radio 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.

checkout-two-column.md
# Brok UI block: Checkout (`checkout-two-column`)

A two-column checkout page with a contact, shipping, delivery and payment form beside a sticky order summary card with promo code, totals and a place-order button.

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/checkout-two-column
```

## Render it

```blade
<x-blocks.checkout-two-column />
```

## Props

- `heading` (string, default `Checkout`)
- `subheading` (string, default `Complete your order in a few quick steps.`)
- `action` (string, default `#`)
- `items` (mixed|null, default `null`)
- `delivery-options` (mixed|null, default `null`)
- `currency` (string, default `$`)
- `subtotal` (string, default `236.00`)
- `shipping` (string, default `12.00`)
- `tax` (string, default `19.84`)
- `total` (string, default `267.84`)

## Use when

- Checking a cart out with a contact, shipping, delivery and payment form beside a sticky order-summary card.
- Showing a promo-code field and a full cost breakdown (subtotal, shipping, tax, total) before the place-order button.

## Avoid when

- Use checkout-stepper for a multi-step stepper checkout, or checkout-express for a compact single-column express checkout.

## Rules

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

  • Checking a cart out with a contact, shipping, delivery and payment form beside a sticky order-summary card.
  • Showing a promo-code field and a full cost breakdown (subtotal, shipping, tax, total) before the place-order button.

Avoid when

  • Use checkout-stepper for a multi-step stepper checkout, or checkout-express for a compact single-column express checkout.

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.checkout-two-column />

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/checkout-two-column.blade.php Blade
@props([
    'heading' => 'Checkout',
    'subheading' => 'Complete your order in a few quick steps.',
    'action' => '#',
    'items' => null,
    'deliveryOptions' => null,
    'currency' => '$',
    'subtotal' => '236.00',
    'shipping' => '12.00',
    'tax' => '19.84',
    'total' => '267.84',
])

@php
    $items ??= [
        [
            'name' => 'Aerolight Running Shoes',
            'variant' => 'Slate / US 10',
            'qty' => 1,
            'price' => '128.00',
            'initials' => 'AR',
        ],
        [
            'name' => 'Merino Crew Socks (3-pack)',
            'variant' => 'Charcoal',
            'qty' => 2,
            'price' => '54.00',
            'initials' => 'MS',
        ],
    ];

    $deliveryOptions ??= [
        [
            'value' => 'standard',
            'label' => 'Standard',
            'detail' => '4–6 business days',
            'price' => '12.00',
            'checked' => true,
        ],
        [
            'value' => 'express',
            'label' => 'Express',
            'detail' => '2–3 business days',
            'price' => '24.00',
            'checked' => false,
        ],
        [
            'value' => 'overnight',
            'label' => 'Overnight',
            'detail' => 'Next business day',
            'price' => '38.00',
            'checked' => false,
        ],
    ];
@endphp

<x-ui.section space="lg" {{ $attributes }}>
    <x-ui.container gutter="sm">
        <header class="mx-auto max-w-2xl">
            <h1 class="text-3xl font-bold tracking-tight sm:text-4xl">{{ __($heading) }}</h1>
            @if ($subheading)
                <p class="mt-2 text-pretty text-muted-foreground">{{ __($subheading) }}</p>
            @endif
        </header>

        <form method="POST" action="{{ $action }}" class="mt-10 grid grid-cols-1 gap-10 lg:grid-cols-3 lg:items-start">
            @csrf

            {{-- Left column: form sections --}}
            <div class="space-y-10 lg:col-span-2">

                {{-- Contact --}}
                <fieldset class="space-y-4">
                    <legend class="text-lg font-semibold tracking-tight">{{ __('Contact') }}</legend>
                    <x-ui.field>
                        <x-ui.label for="checkout-email" required>{{ __('Email address') }}</x-ui.label>
                        <x-ui.input
                            id="checkout-email"
                            type="email"
                            name="email"
                            autocomplete="email"
                            required
                            placeholder="{{ __('you@example.com') }}"
                        />
                        <p class="text-sm text-muted-foreground">{{ __('Order confirmation and receipts are sent here.') }}</p>
                    </x-ui.field>
                </fieldset>

                {{-- Shipping address --}}
                <fieldset class="space-y-4">
                    <legend class="text-lg font-semibold tracking-tight">{{ __('Shipping address') }}</legend>

                    <div class="grid grid-cols-1 gap-4 sm:grid-cols-2">
                        <x-ui.field>
                            <x-ui.label for="checkout-first-name" required>{{ __('First name') }}</x-ui.label>
                            <x-ui.input id="checkout-first-name" name="first_name" autocomplete="given-name" required placeholder="{{ __('Jane') }}" />
                        </x-ui.field>
                        <x-ui.field>
                            <x-ui.label for="checkout-last-name" required>{{ __('Last name') }}</x-ui.label>
                            <x-ui.input id="checkout-last-name" name="last_name" autocomplete="family-name" required placeholder="{{ __('Doe') }}" />
                        </x-ui.field>
                    </div>

                    <x-ui.field>
                        <x-ui.label for="checkout-address" required>{{ __('Street address') }}</x-ui.label>
                        <x-ui.input id="checkout-address" name="address" autocomplete="street-address" required placeholder="{{ __('123 Market Street') }}" />
                    </x-ui.field>

                    <x-ui.field>
                        <x-ui.label for="checkout-apartment">{{ __('Apartment, suite, etc.') }}</x-ui.label>
                        <x-ui.input id="checkout-apartment" name="apartment" autocomplete="address-line2" placeholder="{{ __('Optional') }}" />
                    </x-ui.field>

                    <div class="grid grid-cols-1 gap-4 sm:grid-cols-6">
                        <div class="sm:col-span-3">
                            <x-ui.field>
                                <x-ui.label for="checkout-city" required>{{ __('City') }}</x-ui.label>
                                <x-ui.input id="checkout-city" name="city" autocomplete="address-level2" required placeholder="{{ __('San Francisco') }}" />
                            </x-ui.field>
                        </div>
                        <div class="sm:col-span-2">
                            <x-ui.field>
                                <x-ui.label for="checkout-state" required>{{ __('State') }}</x-ui.label>
                                <x-ui.input id="checkout-state" name="state" autocomplete="address-level1" required placeholder="{{ __('CA') }}" />
                            </x-ui.field>
                        </div>
                        <div class="sm:col-span-1">
                            <x-ui.field>
                                <x-ui.label for="checkout-zip" required>{{ __('ZIP') }}</x-ui.label>
                                <x-ui.input id="checkout-zip" name="postal_code" inputmode="numeric" autocomplete="postal-code" required placeholder="{{ __('94103') }}" />
                            </x-ui.field>
                        </div>
                    </div>

                    <x-ui.field>
                        <x-ui.label for="checkout-phone">{{ __('Phone') }}</x-ui.label>
                        <x-ui.input id="checkout-phone" type="tel" name="phone" autocomplete="tel" placeholder="{{ __('+1 (555) 000-0000') }}" />
                    </x-ui.field>
                </fieldset>

                {{-- Delivery method --}}
                <fieldset class="space-y-4">
                    <legend class="text-lg font-semibold tracking-tight">{{ __('Delivery method') }}</legend>

                    <div class="grid grid-cols-1 gap-4 sm:grid-cols-3">
                        @foreach ($deliveryOptions as $option)
                            <label
                                for="delivery-{{ $option['value'] }}"
                                class="flex cursor-pointer items-start gap-4 rounded-lg border border-input bg-card p-6 transition-colors hover:bg-accent has-[:checked]:border-primary has-[:checked]:ring-1 has-[:checked]:ring-ring has-[:focus-visible]:ring-2"
                            >
                                <x-ui.radio
                                    id="delivery-{{ $option['value'] }}"
                                    name="delivery_method"
                                    value="{{ $option['value'] }}"
                                    class="mt-0.5"
                                    :checked="$option['checked']"
                                />
                                <span class="min-w-0 flex-1">
                                    <span class="block text-sm font-medium text-foreground">{{ __($option['label']) }}</span>
                                    <span class="block text-sm text-muted-foreground">{{ __($option['detail']) }}</span>
                                    <span class="mt-2 block text-sm font-semibold text-foreground">{{ $currency }}{{ $option['price'] }}</span>
                                </span>
                            </label>
                        @endforeach
                    </div>
                </fieldset>

                {{-- Payment --}}
                <fieldset class="space-y-4">
                    <legend class="text-lg font-semibold tracking-tight">{{ __('Payment') }}</legend>

                    <label
                        for="payment-card"
                        class="flex cursor-pointer items-center gap-4 rounded-lg border border-input bg-card p-6 transition-colors hover:bg-accent has-[:checked]:border-primary has-[:checked]:ring-1 has-[:checked]:ring-ring"
                    >
                        <x-ui.radio id="payment-card" name="payment_method" value="card" checked />
                        <span class="flex flex-1 items-center justify-between">
                            <span class="text-sm font-medium text-foreground">{{ __('Credit or debit card') }}</span>
                            <svg class="size-6 text-muted-foreground" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
                                <rect x="2" y="5" width="20" height="14" rx="2" />
                                <path d="M2 10h20" />
                            </svg>
                        </span>
                    </label>

                    <x-ui.field>
                        <x-ui.label for="checkout-card-number" required>{{ __('Card number') }}</x-ui.label>
                        <x-ui.input
                            id="checkout-card-number"
                            name="card_number"
                            inputmode="numeric"
                            autocomplete="cc-number"
                            required
                            placeholder="{{ __('1234 1234 1234 1234') }}"
                        />
                    </x-ui.field>

                    <div class="grid grid-cols-1 gap-4 sm:grid-cols-3">
                        <div class="sm:col-span-1">
                            <x-ui.field>
                                <x-ui.label for="checkout-card-name" required>{{ __('Name on card') }}</x-ui.label>
                                <x-ui.input id="checkout-card-name" name="card_name" autocomplete="cc-name" required placeholder="{{ __('Jane Doe') }}" />
                            </x-ui.field>
                        </div>
                        <div class="sm:col-span-1">
                            <x-ui.field>
                                <x-ui.label for="checkout-card-expiry" required>{{ __('Expiry') }}</x-ui.label>
                                <x-ui.input id="checkout-card-expiry" name="card_expiry" inputmode="numeric" autocomplete="cc-exp" required placeholder="{{ __('MM / YY') }}" />
                            </x-ui.field>
                        </div>
                        <div class="sm:col-span-1">
                            <x-ui.field>
                                <x-ui.label for="checkout-card-cvc" required>{{ __('CVC') }}</x-ui.label>
                                <x-ui.input id="checkout-card-cvc" name="card_cvc" inputmode="numeric" autocomplete="cc-csc" required placeholder="{{ __('123') }}" />
                            </x-ui.field>
                        </div>
                    </div>
                </fieldset>
            </div>

            {{-- Right column: sticky order summary --}}
            <aside class="lg:sticky lg:top-8" aria-labelledby="checkout-summary-title">
                <x-ui.card class="p-6">
                    <h2 id="checkout-summary-title" class="text-lg font-semibold tracking-tight">{{ __('Order summary') }}</h2>

                    <ul role="list" class="mt-6 space-y-4">
                        @foreach ($items as $item)
                            <li class="flex items-start gap-4">
                                <span
                                    class="flex size-14 shrink-0 items-center justify-center rounded-md bg-muted text-sm font-semibold text-muted-foreground"
                                    aria-hidden="true"
                                >
                                    {{ $item['initials'] }}
                                </span>
                                <div class="min-w-0 flex-1">
                                    <p class="truncate text-sm font-medium text-foreground">{{ __($item['name']) }}</p>
                                    <p class="truncate text-sm text-muted-foreground">{{ __($item['variant']) }}</p>
                                    <p class="text-sm text-muted-foreground">{{ __('Qty') }} {{ $item['qty'] }}</p>
                                </div>
                                <p class="shrink-0 text-sm font-medium text-foreground">{{ $currency }}{{ $item['price'] }}</p>
                            </li>
                        @endforeach
                    </ul>

                    <x-ui.separator class="my-6" />

                    <div class="space-y-2">
                        <x-ui.label for="checkout-promo">{{ __('Promo code') }}</x-ui.label>
                        <div class="flex items-stretch gap-2">
                            <x-ui.input
                                id="checkout-promo"
                                name="promo_code"
                                autocomplete="off"
                                class="flex-1"
                                placeholder="{{ __('Enter code') }}"
                            />
                            <x-ui.button type="submit" name="intent" value="apply_promo" variant="outline">
                                {{ __('Apply') }}
                            </x-ui.button>
                        </div>
                    </div>

                    <x-ui.separator class="my-6" />

                    <div class="space-y-4 text-sm">
                        <div class="flex items-center justify-between">
                            <span class="text-muted-foreground">{{ __('Subtotal') }}</span>
                            <span class="font-medium text-foreground">{{ $currency }}{{ $subtotal }}</span>
                        </div>
                        <div class="flex items-center justify-between">
                            <span class="text-muted-foreground">{{ __('Shipping') }}</span>
                            <span class="font-medium text-foreground">{{ $currency }}{{ $shipping }}</span>
                        </div>
                        <div class="flex items-center justify-between">
                            <span class="text-muted-foreground">{{ __('Tax') }}</span>
                            <span class="font-medium text-foreground">{{ $currency }}{{ $tax }}</span>
                        </div>

                        <x-ui.separator class="my-2" />

                        <div class="flex items-center justify-between text-sm">
                            <span class="font-semibold text-foreground">{{ __('Total') }}</span>
                            <span class="font-semibold text-foreground">{{ $currency }}{{ $total }}</span>
                        </div>
                    </div>

                    <x-ui.button type="submit" name="intent" value="place_order" class="mt-6 w-full">
                        <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">
                            <rect x="5" y="11" width="14" height="10" rx="2" />
                            <path d="M8 11V7a4 4 0 0 1 8 0v4" />
                        </svg>
                        {{ __('Place order') }}
                    </x-ui.button>

                    <p class="mt-4 flex items-center justify-center gap-2 text-sm text-muted-foreground">
                        <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">
                            <rect x="5" y="11" width="14" height="10" rx="2" />
                            <path d="M8 11V7a4 4 0 0 1 8 0v4" />
                        </svg>
                        {{ __('Secured with 256-bit SSL encryption.') }}
                    </p>
                </x-ui.card>
            </aside>
        </form>
    </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.0.4
Status
Stable
License
open
Deprecation
Not deprecated
Contract
v1
Foundation
≥ 1.0.0