Base JS behaviour

Dialog

A native <dialog> modal entangled with Livewire; type-to-confirm deletion, teammate invites and action footers.

Real scenarios

The component as it is used in a product — not a specimen grid.

Delete the workspace — prove you mean it

Backdrop clicks are off here; the red button stays inert until the name matches exactly. Esc still works.

Delete nabu-store?

Every board, file and integration goes with it.

Type the workspace name to arm the button: nabu-store

The everyday one: invite a teammate

Title and description feed the dialog’s accessible names; the footer carries the quiet and the loud action.

Invite to nabu-store

They receive an email and join with the role you pick.

Important props

Important props
Prop Type Default What it does
wire:model bool — Open/close bound to a Livewire property — from both the server and the client.
title / description string null The dialog head; aria-labelledby/describedby are wired automatically.
size string md Dialog width: sm · md · lg · xl · full.
closeOnBackdrop bool true Clicking the backdrop closes; turn it off for dangerous forms.
footer slot — The closing slot for the button row.

Snippet

<x-nx::button variant="danger" wire:click="$set('state.confirmOpen', true)">
    حذف ورک‌اسپیس
</x-nx::button>

<x-nx::dialog wire:model="state.confirmOpen" title="حذف ورک‌اسپیس"
    description="این کار برگشت‌پذیر نیست" size="sm" :close-on-backdrop="false">
    <p>برای تایید، نام ورک‌اسپیس را بنویسید.</p>
    <x-slot:footer>
        <x-nx::button variant="ghost" wire:click="$set('state.confirmOpen', false)">انصراف</x-nx::button>
        <x-nx::button variant="danger" wire:click="save('حذف شد')">حذف کن</x-nx::button>
    </x-slot:footer>
</x-nx::dialog>