--- title: "toast" description: "Toast region; dispatch a `toast` window event to show one." category: "Feedback" --- # toast Toast region; dispatch a `toast` window event to show one. ## Installation ```bash php artisan ui:add toast ``` ## Dependencies - composer: `gehrisandro/tailwind-merge-laravel` ## Usage ```blade Show toast {{-- One region per page. position: bottom-right (default), bottom-left, top-right, top-left or top-center. --}} ``` ## Example The demo rendered on the docs page. ```blade
Show toast
``` ## Source Copy this file to the path shown above it. `resources/views/components/ui/toast.blade.php` ```blade @props([ 'position' => 'bottom-right', ]) @php $anchor = match ($position) { 'top-right' => 'top-4 right-4', 'top-left' => 'top-4 left-4', 'bottom-left' => 'bottom-4 left-4', default => 'bottom-4 right-4', }; $regionClasses = \TailwindMerge\Laravel\Facades\TailwindMerge::merge( 'fixed z-[100] flex flex-col gap-2 w-full max-w-sm', $anchor, $attributes->get('class'), ); @endphp
except('class') }}> {{-- Cloned once per toast; edit the markup here to restyle them. --}}
@once @endonce ``` ## Theme tokens `--background`, `--border`, `--foreground`, `--muted-foreground`, `--radius` Ships its own inline