react-toastly-jsx
Version:
A beautiful React toast notification library with animations, gradients, sounds, and premium features for free.
34 lines (30 loc) • 641 B
JSX
import React from "react";
const Toast = ({ message, type }) => {
const bgColor =
type === "success"
? "#4caf50"
: type === "error"
? "#f44336"
: type === "warning"
? "#ff9800"
: type === "info"
? "#2196f3"
: "#555";
return (
<div
style={{
padding: "12px 20px",
borderRadius: 8,
color: "white",
fontWeight: "bold",
backgroundColor: bgColor,
boxShadow: "0 2px 6px rgba(0,0,0,0.3)",
opacity: 0.9,
animation: "slideIn 0.3s ease forwards",
}}
>
{message}
</div>
);
};
export default Toast;