Stacked accordion
Cards stack like a deck; opening one grows it and fans the deck out with a spring.
Real scenarios
The component as it is used in a product — not a specimen grid.
Pick a shipping method
type="single": opening a card fans the deck out and grows the chosen one; its slot carries the real details. The open id travels to Livewire.
Riders nearby right now: 14
Price is calculated per kilometer; the parcel is insured up to 5 million lira.
Free on orders above one million lira — otherwise 38,000 lira
Two stores in Istanbul hold your basket for an hour:
Chosen on the server:
["express"]
The support FAQ, several at once
type="multiple" keeps every open card open; the ids land in Livewire as an array.
Open cards:
["refund"]
Important props
| Prop | Type | Default | What it does |
|---|---|---|---|
| items | array | [] | Each item: id, title, subtitle, icon, content and disabled; richer content through the slot named after the id. |
| type | string | single | single (one card at a time) or multiple (several together). |
| value / wire:model | array | [] | The open ids; wire:model binds the array of open ids. |
| collapsible | bool | true | Allows closing the only open card. |
| heading-level | int | 3 | The headings’ level for a correct page outline (2 to 6). |
Snippet
<x-nx::stacked-accordion type="multiple" :value="$state['shipping'] ?? ['express']"
wire:model.live="state.shipping" :items="[
['id' => 'express', 'title' => 'پیک فوری', 'subtitle' => 'استانبول، زیر ۲ ساعت', 'icon' => 'zap',
'content' => 'ارسال همان روز با پیک؛ هزینه ۴۹٬۰۰۰ تومان.'],
['id' => 'post', 'title' => 'پست پیشتاز', 'subtitle' => 'سراسر کشور، ۲ تا ۴ روز', 'icon' => 'globe',
'content' => 'مطمئن و ارزان — رایگان روی سفارشهای بالای یک میلیون.'],
]" />