Toast
Geçici bildirimler; JS, Livewire ve session flash ile.
Geri bildirim ve overlay
VSnackbar · VSnackbarQueue
3 örnek
JS ile
Armada.toast({ title, text, tone }). Layout'a bir kez <armada:toaster /> eklenir.
Kodu göster
blade
<div class="sc-row">
<armada:button x-data x-on:click="Armada.toast({ title: 'Kaydedildi', text: 'Değişiklikler yayında.', tone: 'success' })">Başarı</armada:button>
<armada:button x-data x-on:click="Armada.toast({ title: 'Bağlantı koptu', text: 'Tekrar deneniyor…', tone: 'warning' })">Uyarı</armada:button>
<armada:button x-data x-on:click="Armada.toast({ title: 'Silinemedi', text: 'Yetkiniz yok.', tone: 'danger' })">Hata</armada:button>
<armada:button x-data x-on:click="Armada.toast('Kısa bilgi mesajı')">Sadece başlık</armada:button>
</div>
Eylemli ve kalıcı
duration: 0 ile kapanana kadar kalır.
Kodu göster
blade
<armada:button x-data x-on:click="Armada.toast({ title: 'Dosya silindi', tone: 'info', duration: 0, action: { label: 'Geri al', onClick: () => Armada.toast({ title: 'Geri alındı', tone: 'success' }) } })">Geri al eylemli</armada:button>
Livewire ve session
Sunucudan da gönderebilirsin.
php
// Livewire bileşeninde
$this->dispatch('toast', title: 'Kaydedildi', tone: 'success');
// Controller'da (yönlendirmeden sonra gösterilir)
return back()->with('toast', 'Profil güncellendi');
Kodu göster
blade
@php
$snippet = <<<'PHP'
// Livewire bileşeninde
$this->dispatch('toast', title: 'Kaydedildi', tone: 'success');
// Controller'da (yönlendirmeden sonra gösterilir)
return back()->with('toast', 'Profil güncellendi');
PHP;
@endphp
<armada:code language="php" :code="$snippet" />
Özellikler
<armada:toaster>
Değerler: bottom-right | bottom-left | bottom-center | top-right | top-center
| Prop | Varsayılan | Not |
|---|---|---|
position |
'bottom-right' |