toasty-toast
v0.0.2
Published
A web component for toast alert messages
Downloads
93
Readme
toasty-toast
Examples:
<toasty-toaster vertical="[top,bottom,center]" horizontal="[left,right,center]">
<toasty-toast hidden>
<p>Message</p>
<button name="close">Close</button>
</toasty-toast>
<!-- Disappears after 5 seconds -->
<toasty-toast hidden timeout="5">
<p>Message</p>
<button name="close">Close</button>
</toasty-toast>
</toasty-toaster>
Installation
You have a few options (choose one of these):
- Install via npm:
npm install toasty-toast
- Download the source manually from GitHub into your project.
- Skip this step and use the script directly via a 3rd party CDN (not recommended for production use)
Usage
Make sure you include the <script>
in your project (choose one of these):
<!-- Host yourself -->
<script type="module" src="toasty-toast.js"></script>
<!-- 3rd party CDN, not recommended for production use -->
<script
type="module"
src="https://www.unpkg.com/[email protected]/toasty-toast.js"
></script>