A three-pane mail client: the folder rail, the message list and a reading pane with a reply composer — opening a message also marks it read, stars and tallies stay live, and dates and digits follow the page’s locale; replies leave through the nx-reply event or a Livewire method.
Real scenarios
The component as it is used in a product — not a specimen grid.
The support inbox
The six built-in folders with unread tallies in the page’s digits; opening a message folds its unread bar away, the star works from both the list and the reading pane, and the arrow keys (Home and End too) walk the rows. Send a reply — Enter sends, Shift+Enter breaks a line — and the nx-reply event reports back through a toast.
-
Nothing here
Demo walkthrough at 10 tomorrow?
Hi;
Does 10 o'clock still work for the walkthrough?
I'll bring the Persian-digits report with me.
The December invoices are ready for review
Hello;
All 214 invoices of December are exported.
Two of them want a second look at their VAT.
[nabuxui] PR #421 merged
kenji-sato merged 3 commits into main.
2 checks passed.
Contract signed
Sent from the legal desk — the countersigned copy is yours.
One-time password
Your code is 4821 — never share it.
Select a message to read it
The “starred” folder is virtual — it gathers the starred of every folder. Without reply-action everything stays in the browser and nx-folder / nx-open / nx-star / nx-reply bubble for you to handle.
The shop’s correspondence desk
The built-ins step aside for the shop’s own folders — orders, billing, shipping, contracts — with icons from the same core set. Replies now ride reply-action: the composer clears and $wire.save(text, messageId) is called — this demo’s slow action (0.9s), which toasts the reply text back.
-
Nothing here
When does order 1248 arrive?
Hi;
The order was placed on Tuesday — any news yet?
The customer is asking again.
Transaction 9812 settled
The amount reaches your account within two working days.
Parcel 1248 handed to the courier
It left the Tabriz hub at 6:40.
Reseller agreement, version 2
Two clauses changed; the redlines are attached.
Select a message to read it
The open message, server-side
The virtual starred folder opens the scene, and the message being read rides wire:model.live back to the server (the root exposes x-modelable="open") — exactly what a server-side unread counter would need.
-
Nothing here
Evening-shift handover notes
Three conversations stay open;
9812 is still waiting for billing.
Feedback on the Arabic tone
The formal register reads better now; keep it.
Weekly report
412 conversations, 96% answered within the hour.
Select a message to read it
On the server (wire:model.live):
null
— it stays null until you open a message.
Important props
| Prop | Type | Default | What it does |
|---|---|---|---|
| messages | array | [] | Each message: ['id' => …, 'from' => ['name' => …, 'email' => …, 'avatar' => …], 'to' => …, 'subject' => …, 'body' => … (one paragraph per line, the first line previews the row), 'time' => Carbon|timestamp|ISO|label, 'unread' => bool, 'starred' => bool, 'folder' => …]. |
| folders | array | شش پوشهٔ داخلی | Defaults to inbox · starred · sent · drafts · archive · trash (“starred” is virtual — it gathers every folder’s starred); a list of ['id' => …, 'label' => …, 'icon' => …] replaces them, each one’s badge counting the same messages. |
| open / folder | string | null | The open message’s id (the folder’s first by default) and the starting folder; open also binds through wire:model on the root (x-modelable), so the server knows which message is being read. |
| replyAction | string | null | A Livewire method name; once a reply is sent the composer clears and $wire.action(text, messageId) fires. Without it the nx-folder / nx-open / nx-star / nx-reply events bubble on the element itself. |
| height | string | 36rem | The whole frame’s height (riding --nx-email-height). |
| placeholder / emptyText / labels / locale | string / string / array / string | null / null / [] / null | The composer placeholder, the empty-folder text, overrides for the built-in words, and the dates-and-digits locale (the app’s by default); the keys come from the core i18n table (fa/en/ar). |
Snippet
<x-nx::email :messages="[
['id' => 'm1', 'from' => ['name' => 'سارا رضایی', 'email' => 'sara@nabu.ai'],
'subject' => 'جلسهٔ دمو ساعت ۱۰ فردا؟', 'body' => "سلام؛\nهمان ساعت ۱۰ میماند؟",
'time' => now()->subMinutes(18), 'unread' => true, 'starred' => true],
['id' => 'm2', 'from' => ['name' => 'GitHub'], 'subject' => '[nabuxui] PR merged',
'body' => 'PR #421 merged into main.', 'folder' => 'archive'],
]" open="m1" height="34rem"
x-on:nx-reply="$wire.ping('پاسخ فرستاده شد')" />
{{-- پوشههای خودتان + پاسخ به متد لایووایر --}}
<x-nx::email :messages="$deskMail" :folders="[
['id' => 'orders', 'label' => 'سفارشها', 'icon' => 'file'],
['id' => 'billing', 'label' => 'مالی', 'icon' => 'chart'],
]" folder="orders" reply-action="sendReply" height="30rem" />
{{-- پیامِ باز روی سرور: wire:model روی ریشه (x-modelable) --}}
<x-nx::email :messages="$messages" wire:model.live="openMail" />