@quantabit/toast-sdk
v1.0.2
Published
Universal toast/notification SDK with imperative API, promise support, and 6 positions
Maintainers
Readme
@quantabit/toast-sdk
Universal toast/notification SDK with imperative API
Features
- Imperative API —
toast.success('Done!')anywhere in your code - 5 Types — success, error, warning, info, loading
- Promise Toast —
toast.promise(fetch(...), { loading, success, error }) - 6 Positions — top-right/left/center + bottom variants
- Auto-dismiss — with countdown progress bar
- React Hook —
useToast()for component usage
Quick Start
import { ToastContainer, toast } from '@quantabit/toast-sdk';
import '@quantabit/toast-sdk/styles.css';
// Add container once in your App
function App() {
return (
<>
<ToastContainer position="top-right" />
<button onClick={() => toast.success('Saved!')}>Save</button>
</>
);
}
// Use anywhere
toast.error('Network error');
toast.promise(fetchData(), { loading: 'Loading...', success: 'Done', error: 'Failed' });License
MIT © QuantaBit Team
🌐 Brand & Links
- Official Mainnet: QuantaBit Chain
- Developer Platform: Developer Platform
- Open Platform: Open Platform
- Payment Platform: Pay Platform
- Feedback: Feedback
