Toast
An accessible and beautiful toast library for React.
Framework guides
Getting Started
- Install the library:
bash
- Add the toast provider:
jsx
// 📃 main.tsximport { Toaster }from '@pheralb/toast';ReactDOM.createRoot(document.getElementById('root')!).render( <React.StrictMode> <App /> <Toaster /> </React.StrictMode>,);
- Usage:
jsx
// 📃 index.tsximport { toast }from "@pheralb/toast";export default function Index() { return ( <> <button onClick={()=> toast.success({ text:"pheralb/toast", description:"✨ A beautiful toast library for React", }) } > <span>Render a toast</span> </button> </> );}