tsx
import { ToastProvider } from "@arkyn/components";
tsx
<ToastProvider><App /></ToastProvider>
useToast() inside provider scope to show success and danger notifications.tsx
function SaveAction() {const { showToast } = useToast();return (<buttononClick={() =>showToast({message: "Saved successfully",type: "success",})}>Save</button>);}
tsx
showToast({ message: "Operation completed", type: "success" });showToast({ message: "Something went wrong", type: "danger" });
useToast hook must be called inside
ToastProvider. Outside provider scope, it throws an error.children - ReactNode
React subtree that can access toast context and toaster rendering.