1.0.1 • Published 1 year ago

toast-notify-js v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

toast-notify-js

A simple and customizable toast notification library for JavaScript. This library can be easily integrated into vanilla JavaScript projects and can also be used with React and Vue.

Features

  • Lightweight and simple to use
  • Customizable toast messages
  • Automatic dismissal after a specified duration
  • Works with vanilla JavaScript, React, and Vue

Installation

You can install the library using npm:

npm install toast-notify-js

Usage Vanilla JavaScript Include the CSS file in your HTML: html Copy code

    document.getElementById('show-toast').addEventListener('click', () => {
        toast.show('This is a toast message!');
    });
</script>

function App() { const showToast = () => { toast.show('This is a toast message!'); };

return (
    <div>
        <button onClick={showToast}>Show Toast</button>
    </div>
);

}

export default App; Vue Import the library in your Vue component: javascript Copy code import toast from 'toast-notify-js';

export default { methods: { showToast() { toast.show('This is a toast message!'); } } }; Use the method in your template: html Copy code

Author Hasan Hafizur Rahman

css

1.0.1

1 year ago

1.0.0

1 year ago