انتقل إلى المحتوى
الأدلة
التنقل
التنبيهات
الطبقات العائمة
التخطيط
عرض البيانات
النماذج
.md

الطبقات العائمة

dialog

نافذة حوار مع حصر التركيز وخلفية وإغلاق بزر Esc.

هل أنت متأكد؟

لا يمكن التراجع عن هذا الإجراء.

سيُحذف المشروع وكل بياناته نهائيًا.

التثبيت

php artisan ui:add dialog

الاستخدام

<x-ui.dialog title="Are you sure?" description="This action cannot be undone.">
    <x-slot:trigger>
        <x-ui.button variant="outline">Open dialog</x-ui.button>
    </x-slot:trigger>

    <p class="text-sm text-muted-foreground">Dialog body content.</p>

    <x-slot:footer>
        <x-ui.button variant="outline"
            data-ui-dialog-close>Cancel</x-ui.button>
        <x-ui.button variant="destructive">Delete</x-ui.button>
    </x-slot:footer>
</x-ui.dialog>

مبني على عنصر <dialog> الأصلي (طبقة علوية، حصر التركيز، إغلاق بـ Esc) مع <script> صغير مضمّن؛ بلا اعتماديات JS. خانة trigger تفتح النافذة؛ وخانة footer الاختيارية تعرض أزرار الإجراءات.

الخصائص

كل خاصية مع قيمتها الافتراضية. مرّر أيًّا منها كسمة، واستخدم : لربط قيمة PHP.

@props([
    'title' => null,
    'description' => null,
])