Print layout
A standalone page to print or save as PDF, such as an order slip, an invoice or a report.
zb:layout.print zubazar/ui-pro
This component is in Zubazar UI Pro; Zubazar UI Pro brings Zubazar UI with it. Installing Zubazar UI Pro →
Basic usage
Write the content (usually a table) in the default slot; give amount columns data-align="end".
<zb:layout.print title="Today's orders" :subtitle="now()->format('m/d/Y')">
<table>
<thead><tr><th>Order</th><th>Customer</th><th data-align="end">Amount</th></tr></thead>
<tbody>
@foreach ($orders as $order)
<tr><td>{{ $order->number }}</td><td>{{ $order->customer_name }}</td><td data-align="end">{{ $order->amount }}</td></tr>
@endforeach
</tbody>
</table>
</zb:layout.print>
| Prop | Values |
|---|---|
title | Title of the document; also the tab title |
subtitle | The line under the title |
Order slip
totals shows totals below the content and signatures the signature fields; aside goes opposite the title and footer below the signatures.
<zb:layout.print
title="Order slip"
:subtitle="$order->created_at->format('m/d/Y g:i A')"
:filters="['Customer' => $order->customer_name, 'Delivery' => $order->delivery_method]"
:totals="['Subtotal' => $subtotal, 'VAT' => $vat, 'Total' => $total]"
:signatures="['Prepared by', ['label' => 'Received by', 'name' => $order->customer_name]]"
>
<zb:slot:aside><strong>Zubazar Store</strong><br>Order No. {{ $order->number }}</zb:slot:aside>
<table>
<thead>
<tr><th>Product</th><th data-align="end">Qty</th><th data-align="end">Amount</th></tr>
</thead>
<tbody>
@foreach ($order->lines as $line)
<tr><td>{{ $line->product_name }}</td><td data-align="end">{{ $line->quantity }}</td><td data-align="end">{{ $line->amount }}</td></tr>
@endforeach
</tbody>
</table>
<zb:slot:footer>For returns and exchanges, write to us within 14 days.</zb:slot:footer>
</zb:layout.print>
| Prop | Values |
|---|---|
totals | ['Label' => 'value'] or [['label' => …, 'value' => …]] |
signatures | ['Prepared by'] or [['label' => …, 'name' => …]] |
aside, footer | Slots |
A report and printing on load
auto-print opens the print dialog when the page loads, filters lists the report's filters and orientation="landscape" is for wide tables.
{{-- Route::get('reports/orders/print', PrintOrderReport::class) returns this view. --}}
<zb:layout.print
title="Order report"
:subtitle="now()->format('m/d/Y g:i A').' · '.$orders->count().' orders'"
:filters="['Status' => 'Delivered', 'Period' => '10/01/2026 – 10/14/2026']"
:notice="$cut ? 'Only the first 2,000 orders are shown.' : null"
:totals="['Orders' => $orders->count(), 'Revenue' => $revenue]"
orientation="landscape"
auto-print
>
<table>…</table>
</zb:layout.print>
| Prop | Values |
|---|---|
auto-print | The print window on load |
orientation | portrait | landscape |
notice | A highlighted line |
With Tailwind classes
If the content uses Tailwind classes or kit components, give the application's CSS file in the head slot.
<zb:layout.print title="Shipping labels" size="A5" margin="8mm" :page-numbers="false" :toolbar="false">
<zb:slot:head>@vite('resources/css/app.css')</zb:slot:head>
<div class="grid grid-cols-2 gap-4">…</div>
</zb:layout.print>
| Prop | Values |
|---|---|
size | A4 · A5 · letter… |
margin | 12mm (mm, cm, in, pt, px) |
head | Slot: into <head> |
Props
The values the component takes. What are props and slots?
| Prop | Type | Default | Description |
|---|---|---|---|
title | — | null | The document's title; also the tab title |
subtitle | — | null | The line under the title: the date, the scope, the number of records |
notice | — | null | A highlighted line under the title |
filters | — | [] | The filters the document was made with: ['Status' => 'Active'] or [['label' => …, 'value' => …]] |
totals | — | [] | The totals under the content, in the same form; the last row is the grand total |
signatures | — | [] | Signature boxes: ['Prepared by'] or [['label' => …, 'name' => …]] |
size | — | A4 | The paper size (@page) |
orientation | — | portrait | portrait | landscape |
margin | — | 12mm | The page margin |
page-numbers | boolean | true | "Page 1 / 3" at the bottom of every page |
toolbar | boolean | true | The Print / Close buttons on screen (never printed) |
auto-print | boolean | false | Opens the print window once the page has loaded |
nonce | — | null | The CSP nonce of the inline style and script; Vite::cspNonce() by default |
Slots: Default slot: the document's content; in its tables data-align="end" and "center" set the alignment. head: extra <head> lines. aside: opposite the title. footer: under the signatures. Other attributes go on <body>.
Developer notes
- It has its own styles (light mode, A4, a table header repeated on every page); the panel layout and the application's CSS are not needed.
- On screen, Print and Close buttons show at the top and are hidden in print; users can also save as PDF from the print dialog.
- The page number ("Page 1 / 3") is printed at the bottom of each page in browsers that print page margin boxes.