v0.0.2
Demos (demo panel, opens in a new tab)

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

PRO

This component is in Zubazar UI Pro; Zubazar UI Pro brings Zubazar UI with it. Installing Zubazar UI Pro →

Basic usage

BLADE

Write the content (usually a table) in the default slot; give amount columns data-align="end".

blade
<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>
PropValues
titleTitle of the document; also the tab title
subtitleThe line under the title

Order slip

BLADE

totals shows totals below the content and signatures the signature fields; aside goes opposite the title and footer below the signatures.

blade
<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>
PropValues
totals['Label' => 'value'] or [['label' => …, 'value' => …]]
signatures['Prepared by'] or [['label' => …, 'name' => …]]
aside, footerSlots

A report and printing on load

BLADE

auto-print opens the print dialog when the page loads, filters lists the report's filters and orientation="landscape" is for wide tables.

blade
{{-- 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>
PropValues
auto-printThe print window on load
orientationportrait | landscape
noticeA highlighted line

With Tailwind classes

BLADE

If the content uses Tailwind classes or kit components, give the application's CSS file in the head slot.

blade
<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>
PropValues
sizeA4 · A5 · letter…
margin12mm (mm, cm, in, pt, px)
headSlot: into <head>

Props

The values the component takes. What are props and slots?

PropTypeDefaultDescription
title—nullThe document's title; also the tab title
subtitle—nullThe line under the title: the date, the scope, the number of records
notice—nullA 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—A4The paper size (@page)
orientation—portraitportrait | landscape
margin—12mmThe page margin
page-numbersbooleantrue"Page 1 / 3" at the bottom of every page
toolbarbooleantrueThe Print / Close buttons on screen (never printed)
auto-printbooleanfalseOpens the print window once the page has loaded
nonce—nullThe 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

Events, hooks and details
  • 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.
Zubazar UI · ZubazarDesigned for people.