NanoToast

Usage in Alpine.js

All the features of NanoToast are available in Alpine.js too!

Installation

Using npm
npm install @iamsabbir/nanotoast

Using Yarn
yarn add @iamsabbir/nanotoast

Using CDN
<!-- Add the javascript -->
<script src="https://unpkg.com/@iamsabbir/nanotoast/dist/nanotoast.js"></script>
<!-- Or if you want esm module -->
<script src="https://unpkg.com/@iamsabbir/nanotoast/dist/nanotoast.esm.js"></script>

<!-- Add the css -->
<link rel="stylesheet" href="https://unpkg.com/@iamsabbir/nanotoast/dist/nanotoast.css">

Render a toast

<button x-data @click="toast.success('Hello from Alpine.js!')">Show Toast</button>

More toast types

toast.success("Alpine.js is awesome!");
toast.error("Alpine.js is not awesome!");
toast.warning("Alpine.js is okay!");
toast.info("Alpine.js is great!");