This package provides customizable and animated toast notifications for React applications. It allows you to display notifications with different types, durations, and positions. The package uses CSS animations for smooth and dynamic transitions and comes with multiple features like customizable toast types, positioning, and auto-dismiss functionality.
https://github.com/user-attachments/assets/e34f7b0a-a254-42f0-b256-5feb116ebaea
You can install the package via npm:
npm install animated-toast
import React from 'react';
import { Toast } from 'animated-toast';
const App = () => {
return (
<div>
<Toast message="Success!"
type="success"
duration={3000}
onClose={() => alert("Toast closed!")} />
</div>
);
}
export default App;
Here’s an example of how you can create different types of toast notifications with different positions and durations:
import React from 'react';
import { Toast } from 'animated-toast';
const App = () => {
return (
<div>
{/* Success Toast */}
<Toast message="Success!" type="success" duration={3000} position="topRight" onClose={() => console.log("Success Toast Closed")} />
{/* Error Toast */}
<Toast message="Error occurred!" type="error" duration={5000} position="bottomLeft" onClose={() => console.log("Error Toast Closed")} />
{/* Info Toast */}
<Toast message="Information message" type="info" duration={2000} position="bottomRight" onClose={() => console.log("Info Toast Closed")} />
</div>
);
}
export default App;