The toast is used to show alerts on top of an overlay. The toast
will close itself when the close button is clicked, or after a
timeout — the default is 5 seconds. Check out code for detail of
usage.
The toast is used to show alerts on top of an overlay. The toast
will close itself when the close button is clicked, or after a
timeout — the default is 5 seconds. Check out code for detail of
usage.
<button
class="btn bg-primary font-medium text-white hover:bg-primary-focus focus:bg-primary-focus active:bg-primary-focus/90 dark:bg-accent dark:hover:bg-accent-focus dark:focus:bg-accent-focus dark:active:bg-accent/90"
onclick="$notification({text:'This is a simple notification',variant:'primary'})"
>
Primary
</button>
<button
class="btn bg-secondary font-medium text-white hover:bg-secondary-focus focus:bg-secondary-focus active:bg-secondary-focus/90"
onclick="$notification({text:'This is a simple notification',variant:'secondary'})"
>
Secondary
</button>
<button
class="btn bg-info font-medium text-white hover:bg-info-focus focus:bg-info-focus active:bg-info-focus/90"
onclick="$notification({text:'This is a simple notification',variant:'info'})"
>
Info
</button>
<button
class="btn bg-success font-medium text-white hover:bg-success-focus focus:bg-success-focus active:bg-success-focus/90"
onclick="$notification({text:'This is a simple notification',variant:'success'})"
>
Success
</button>
<button
class="btn bg-warning font-medium text-white hover:bg-warning-focus focus:bg-warning-focus active:bg-warning-focus/90"
onclick="$notification({text:'This is a simple notification',variant:'warning'})"
>
Warning
</button>
<button
class="btn bg-error font-medium text-white hover:bg-error-focus focus:bg-error-focus active:bg-error-focus/90"
onclick="$notification({text:'This is a simple notification',variant:'error'})"
>
Error
</button>
<button
class="btn bg-slate-150 font-medium text-slate-800 hover:bg-slate-200 focus:bg-slate-200 active:bg-slate-200/80"
onclick="$notification({text:'This is a simple notification',variant:'light'})"
>
Light
</button>
<button
class="btn bg-navy-500 font-medium text-slate-200 hover:bg-navy-450 focus:bg-navy-450 active:bg-navy-450/90"
onclick="$notification({text:'This is a simple notification',variant:'dark'})"
>
Dark
</button>
Notification Position
The toast is used to show alerts on top of an overlay. The toast
will close itself when the close button is clicked, or after a
timeout — the default is 5 seconds. Check out code for detail of
usage.
<button
class="btn bg-slate-150 font-medium text-slate-800 hover:bg-slate-200 focus:bg-slate-200 active:bg-slate-200/80 dark:bg-navy-500 dark:text-navy-50 dark:hover:bg-navy-450 dark:focus:bg-navy-450 dark:active:bg-navy-450/90"
onclick="$notification({text:'This is a left top notification',variant:'info',position:'left-top'})"
>
Left Top
</button>
<button
class="btn bg-slate-150 font-medium text-slate-800 hover:bg-slate-200 focus:bg-slate-200 active:bg-slate-200/80 dark:bg-navy-500 dark:text-navy-50 dark:hover:bg-navy-450 dark:focus:bg-navy-450 dark:active:bg-navy-450/90"
onclick="$notification({text:'This is a left bottom notification',variant:'info',position:'left-bottom'})"
>
Left Bottom
</button>
<button
class="btn bg-slate-150 font-medium text-slate-800 hover:bg-slate-200 focus:bg-slate-200 active:bg-slate-200/80 dark:bg-navy-500 dark:text-navy-50 dark:hover:bg-navy-450 dark:focus:bg-navy-450 dark:active:bg-navy-450/90"
onclick="$notification({text:'This is a center top notification',variant:'info',position:'center-top'})"
>
Center Top
</button>
<button
class="btn bg-slate-150 font-medium text-slate-800 hover:bg-slate-200 focus:bg-slate-200 active:bg-slate-200/80 dark:bg-navy-500 dark:text-navy-50 dark:hover:bg-navy-450 dark:focus:bg-navy-450 dark:active:bg-navy-450/90"
onclick="$notification({text:'This is a center bottom notification',variant:'info',position:'center-bottom'})"
>
Center Bottom
</button>
<button
class="btn bg-slate-150 font-medium text-slate-800 hover:bg-slate-200 focus:bg-slate-200 active:bg-slate-200/80 dark:bg-navy-500 dark:text-navy-50 dark:hover:bg-navy-450 dark:focus:bg-navy-450 dark:active:bg-navy-450/90"
onclick="$notification({text:'This is a right top notification',variant:'info',position:'right-top'})"
>
Right Top
</button>
<button
class="btn bg-slate-150 font-medium text-slate-800 hover:bg-slate-200 focus:bg-slate-200 active:bg-slate-200/80 dark:bg-navy-500 dark:text-navy-50 dark:hover:bg-navy-450 dark:focus:bg-navy-450 dark:active:bg-navy-450/90"
onclick="$notification({text:'This is a right bottom notification',variant:'info',position:'right-bottom'})"
>
Right Bottom
</button>
Notification Duration
The toast is used to show alerts on top of an overlay. The toast
will close itself when the close button is clicked, or after a
timeout — the default is 5 seconds. Check out code for detail of
usage.
The toast is used to show alerts on top of an overlay. The toast
will close itself when the close button is clicked, or after a
timeout — the default is 5 seconds. Check out code for detail of
usage.