Inline confirmation
A button that asks for an irreversible row action, such as delete, in place without opening a dialog.
zb:inline-confirm zubazar/ui · free (MIT)
Basic usage
BLADE
Write the question with question; attributes such as wire:click go to the confirm button.
<div class="flex items-center justify-between gap-4 rounded-sm border border-line bg-surface px-4 py-3">
<span class="text-sm">Aura Pro wireless headphones</span>
<zb:inline-confirm question="Delete the product?">Delete</zb:inline-confirm>
</div>
| Prop | Values |
|---|---|
question | The question shown in place of the button |
confirm-text | The confirm button's text (default: the slot) |
Props
The values the component takes. What are props and slots?
| Prop | Type | Default | Description |
|---|---|---|---|
question | — | null | The question; default "Are you sure?" |
confirm-text | — | null | The confirm button's text; default the slot |
cancel-text | — | null | The cancel button's text |
variant | — | danger | The confirm button's colour; the first button is its outline |
size | — | sm | zb:button size |
Developer notes
- The first click turns the button into a question and two buttons; only the confirm button runs the action.
- Escape, Cancel or a click elsewhere brings the button back; the focus moves to the confirm button and then back.