$ Toast
static output4 types
Styled notification messages for terminal output with 4 preset types: success, error, warning, and info. Supports timestamps.
# Preview
toast demo
──────────────────────────────────────
✔ SUCCESS
│ Build completed successfully!
──────────────────────────────────────
──────────────────────────────────────
✖ ERROR
│ Connection refused on port 5432
──────────────────────────────────────
──────────────────────────────────────
⚠ WARNING
│ Deprecated API: use v2 endpoint
──────────────────────────────────────
──────────────────────────────────────
ℹ INFO
│ Server listening on port 3000
──────────────────────────────────────
# Usage
example.ts
import { toast, Toast } from "@vr_patel/tui";
// Quick one-liners
console.log(toast.success("Build completed!"));
console.log(toast.error("Connection failed"));
console.log(toast.warn("Deprecated API"));
console.log(toast.info("Server running on port 3000"));
// With options
const t = new Toast({ timestamp: true });
console.log(t.success("Deployed to production"));# API
| Prop | Type | Default | Description |
|---|---|---|---|
| width | number | 0 (auto) | Fixed width or auto-sized |
| padding | number | 1 | Padding inside the toast |
| timestamp | boolean | false | Show timestamp in header |