Cards with actions
Puts actions such as a dropdown, buttons, collapsing and closing in the card header.
zb:card zubazar/ui-pro
This component is in Zubazar UI Pro; Zubazar UI Pro brings Zubazar UI with it. Installing Zubazar UI Pro →
Dropdown
Put an zb:dropdown in the actions slot; the menu is aligned to the right edge by default (align="end").
<zb:card title="Product summary" subtitle="September 2026">
<zb:slot:actions>
<zb:dropdown align="end">
<zb:slot:trigger><zb:button variant="ghost" size="icon" aria-label="Actions"><zb:icon name="ellipsis-vertical" /></zb:button></zb:slot:trigger>
<zb:dropdown.item>Refresh</zb:dropdown.item>
<zb:dropdown.item href="#">Open products</zb:dropdown.item>
</zb:dropdown>
</zb:slot:actions>
<p class="text-sm text-dim">38 published products, 4 draft products.</p>
</zb:card>
| Prop | Values |
|---|---|
actions | Slot; right of the header |
align (dropdown) | end | start |
Buttons, collapsing and closing
The actions content stays to the left of the collapse and close buttons; keep one or two actions in the header and move the rest to a dropdown.
<zb:card title="Daily summary" collapsible closable>
<zb:slot:actions>
<zb:button size="sm" variant="ghost">All</zb:button>
</zb:slot:actions>
<p class="text-sm text-dim">214 orders came in today; 18 orders were canceled.</p>
</zb:card>
| Prop | Values |
|---|---|
collapsible | true | false |
closable | true | false |
Locking while refreshing
Wrap the card in a relative container and put an zb:loading-overlay next to it; the card stays locked while the show expression is true.
<div class="relative" x-data="{ loading: false }">
<zb:card title="Pending orders">
<zb:slot:actions>
<zb:button size="sm" variant="ghost" x-on:click="loading = true; setTimeout(() => loading = false, 1500)">Refresh</zb:button>
</zb:slot:actions>
<p class="text-sm text-dim">36 orders are waiting to ship.</p>
</zb:card>
<zb:loading-overlay show="loading" />
</div>
| Prop | Values |
|---|---|
show (loading-overlay) | Alpine expression |
Refreshing with Livewire
In a Livewire component, give the overlay the name of the action with target; while that action runs, the card is locked automatically.
<div class="relative">
<zb:card title="Today's orders">
<zb:slot:actions>
<zb:button size="sm" variant="ghost" wire:click="refresh">Refresh</zb:button>
</zb:slot:actions>
…
</zb:card>
<zb:loading-overlay target="refresh" />
</div>
| Prop | Values |
|---|---|
target (loading-overlay) | Livewire action name |
Props
The values the component takes. What are props and slots?
| Prop | Type | Default | Description |
|---|---|---|---|
title, subtitle | — | null | Header area |
collapsible | boolean | false | Collapse button in the header |
closable | boolean | false | Close button in the header |
padding | boolean | true | false: body without padding |
loading-overlay: show · target | — | null | Alpine expression · Livewire action |
Slots: actions (right of the header), footer (footer), default content (body)
Developer notes
- Give an icon-only trigger an
aria-label.