https://github.com/waleedsalah4/notification-system
A customizable toast notification system for React, Angular, and Vue with built-in animations, positioning, auto-dismiss, and more.
https://github.com/waleedsalah4/notification-system
alerts angular context-api custom-toast motion pinia reactjs redux-toolkit toast toast-notifications typescript vue zustand
Last synced: about 2 months ago
JSON representation
A customizable toast notification system for React, Angular, and Vue with built-in animations, positioning, auto-dismiss, and more.
- Host: GitHub
- URL: https://github.com/waleedsalah4/notification-system
- Owner: waleedsalah4
- Created: 2025-06-01T11:20:58.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2026-03-13T01:21:14.000Z (3 months ago)
- Last Synced: 2026-03-13T07:55:27.964Z (3 months ago)
- Topics: alerts, angular, context-api, custom-toast, motion, pinia, reactjs, redux-toolkit, toast, toast-notifications, typescript, vue, zustand
- Language: TypeScript
- Homepage: https://notification-toast.vercel.app/
- Size: 585 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# π Notification Toast
A customizable toast notification system with built-in animations, icons, positioning, delay appearance, and more.
Implemented across **React**, **Angular**, and **Vue 3** β each in its own branch, each exploring a different approach to state management.

---
## π Features
- β‘ Simple one-liner API β `addToast()` / service injection / Pinia action
- π¨ 8 built-in variants β Primary, Secondary, Success, Error, Warning, Info, Light, Dark
- π 6 configurable positions β Top/Bottom Β· Left/Right/Center
- π¨ Auto-dismiss with animated glowing progress bar
- π± Pause on hover β timer freezes on mouse-over
- π Delay appearance β show toast after a short delay
- π§© Optional title, custom message, and per-variant icons
- π `onCloseToast` callback β fires on auto or manual dismiss
- β¨ Fluid animations powered by **motion/react** and **motion-v**
---
## π Branches
| Branch | Framework | State Management |
|---|---|---|
| `main` | React | Redux Toolkit |
| `toast-with-zustand` | React | Zustand |
| `toast-with-context-api` | React | Context API + useReducer |
| `toasts-in-angular` | Angular 17+ | Angular Signals |
| `toasts-in-vue` | Vue 3 | Pinia |
---
## π§± Usage
### React (Redux Toolkit)
```tsx
dispatch(addToast({
type: "success",
title: "Done!",
message: "Your changes have been saved.",
delayAppearance: false,
onCloseToast: () => console.log("closed"),
}));
```
### React (Zustand)
```tsx
const { addToast } = useToastStore();
addToast({
type: "info",
message: "Zustand-powered toast!",
});
```
### React (Context API)
```tsx
const { addToast } = useToastContext();
addToast({
type: "warning",
title: "Heads up",
message: "Context API toast, no extra libraries.",
});
```
### Angular
```ts
// inject
private toastService = inject(ToastService);
this.toastService.addToast({
type: "success",
title: "Success",
message: "Angular Signals-powered toast!",
delayAppearance: false,
});
```
### Vue 3 (Pinia)
```ts
const toastStore = useToastStore();
toastStore.addToast({
type: "success",
title: "Saved!",
message: "Vue 3 + Pinia toast.",
});
```
---
## π Props / API
| Prop | Type | Default | Description |
|---|---|---|---|
| `type` | `ToastVariant` | **required** | Visual variant (success, error, infoβ¦) |
| `message` | `string` | **required** | Main notification text |
| `title` | `string` | `β` | Optional bold heading above the message |
| `id` | `string` | auto | Unique ID β auto-generated if omitted |
| `delayAppearance` | `boolean` | `false` | Show toast after a short delay (~1s) |
| `onCloseToast` | `() => void` | `β` | Callback fired when toast is dismissed |
---
## π¦ Getting Started
Clone the repo and switch to your desired branch:
```bash
git clone https://github.com/waleedsalah4/notification-system.git
cd notification-system
```
### React (main / zustand / context-api)
```bash
git checkout main # or toast-with-zustand / toast-with-context-api
npm install
npm run dev
```
### Angular
```bash
git checkout toasts-in-angular
npm install
ng serve
```
### Vue 3
```bash
git checkout toasts-in-vue
npm install
npm run dev
```
---
## π Built With
### React branches
- React 19 Β· TypeScript Β· Vite
- Redux Toolkit / Zustand / Context API
- Tailwind CSS Β· motion/react
### Angular branch
- Angular 17+ Β· TypeScript
- Standalone Components Β· Angular Signals
- Tailwind CSS
### Vue 3 branch
- Vue 3 Β· TypeScript Β· Vite
- Pinia Β· motion-v
- Tailwind CSS