v0.0.2
Demos (demo panel, opens in a new tab)

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

Basic usage: view
BLADE

Write the question with question; attributes such as wire:click go to the confirm button.

blade
<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>
PropValues
questionThe question shown in place of the button
confirm-textThe confirm button's text (default: the slot)

Props

The values the component takes. What are props and slots?

PropTypeDefaultDescription
question—nullThe question; default "Are you sure?"
confirm-text—nullThe confirm button's text; default the slot
cancel-text—nullThe cancel button's text
variant—dangerThe confirm button's colour; the first button is its outline
size—smzb:button size

Developer notes

Events, hooks and details
  • 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.