Skip to main content
Version: 1.0.2

Toast

Overview

The Toast component is a versatile notification system that provides animated, customizable alerts. Built with Framer Motion, it supports multiple variants, animations, themes, and appearance styles, making it perfect for providing feedback in your applications.

Preview

Installation

npx @mindfiredigital/ignix-ui add toast

Usage

First, wrap your application with the ToastProvider:

import { ToastProvider } from './components/ui';

function App() {
return (
<ToastProvider>
<YourApp />
</ToastProvider>
);
}

Then use the toast in your components:

import { useToast } from './components/ui';

function MyComponent() {
const toast = useToast();

const showNotification = () => {
toast.addToast({
message: "Operation successful!",
variant: "success",
animation: "slide",
mode: "light",
icon: <CheckCircledIcon />
});
};

return <button onClick={showNotification}>Show Toast</button>;
}

Features