Accordion
Over native <details>; animated open/close height with a grouped single-open mode.
Real scenarios
The component as it is used in a product — not a specimen grid.
The shop’s support FAQ
The default list: single-open and joined, so opening a question folds the previous one. Every item is a native details element, so the answers sit in the page from the first paint — find-in-page and Tab navigation work before any JavaScript does, and the single-open rule itself is just a shared name on those details.
When will my order arrive?
Can I return an item?
Do you offer cash on delivery?
How do I get an official invoice?
The chevron turning over is only the extra cue — the row’s background and text weight change with it too.
The payment settings, section by section
With variant="separated" and :single="false" every section becomes its own card and stays open on its own — while you edit the payout account the gateway form you filled does not fold away. The slot holds real controls: the switch posts live (wire:model.live) and the fields ride along with the save button.
Payment gateway
From your bank’s payment panel.
Official invoice
16 digits, without spaces.
Payout account
Payouts land on this account every Thursday; a new number applies after two cycles.
Only cash on delivery, for now
Nothing is committed until the save — the fields only bind to the component’s state.
The recent orders, details unfolding in place
The slot is not limited to a paragraph of text: each order opens to its line items, its total and its own action. :single="false" lets you keep two orders open side by side and compare them, and every amount runs through NabuXUI::formatNumber so it turns into Persian digits under the Persian locale.
Order #981 · Oct 6
- Hand-stitched leather bag × 1 890,000 tomans
- Desktop charger × 1 390,000 tomans
Order #967 · Oct 1
- Hand-painted ceramic mug × 2 450,000 tomans
Order #954 · Sep 24
- Linen notebook × 3 720,000 tomans
- Brass bookmark set × 1 320,000 tomans
The first order arrives open (the open prop) so the stage never shows an empty accordion.
Important props
| Prop | Type | Default | What it does |
|---|---|---|---|
| single | bool | true | Only one item open; achieved via a shared name on the details. |
| variant | string | joined | joined or separated. |
| title (آیتم) | string | — | The accordion-item title; it becomes the summary and the whole clickable row. |
| open (آیتم) | bool | false | The item is open from the first render; keep just one open in single mode. |
Snippet
<x-nx::accordion single>
<x-nx::accordion-item title="سفارشم کی میرسد؟" open>…پاسخ…</x-nx::accordion-item>
<x-nx::accordion-item title="کالا را میتوانم برگردانم؟">…پاسخ…</x-nx::accordion-item>
</x-nx::accordion>
<x-nx::accordion :single="false" variant="separated">
<x-nx::accordion-item title="درگاه پرداخت" open>
<x-nx::switch label="پرداخت آنلاین" wire:model.live="state.pay.online" />
</x-nx::accordion-item>
<x-nx::accordion-item title="حساب تسویه">…فرم…</x-nx::accordion-item>
</x-nx::accordion>