PyBlade/ui
Menu⌄
DocsComponentsToaster

Toaster

Toast notifications, raised from JavaScript with toast({...}).

Alpine.js1 file

Installation

pyblade-ui add toaster

Usage

The tag <pb-ui.toaster> is available in all your templates.

<pb-ui.toaster position="bottom-right" />
<pb-ui.button x-on:click="toast({ title: 'Saved', variant: 'success' })">Save</pb-ui.button>

Props

PropDefault
position'bottom-right'
duration4000

Any other attribute (class, id, x-on:click, hx-post…) is passed to the root element; your Tailwind classes win over the component's.