-
Notifications
You must be signed in to change notification settings - Fork 0
Notifications
Nikita Mogilevskii edited this page Dec 11, 2025
·
1 revision
The notification system provides lightweight, macOS-style popup messages that appear in the top-right corner of the screen. Notifications slide in, auto-dismiss, can be swiped away, and support optional icons.
Wrap your application with NotificationProvider to enable notifications globally.
import { NotificationProvider } from './NotificationProvider';
root.render(
<NotificationProvider>
<App />
</NotificationProvider>
);You can trigger a notification from any component inside the provider using useNotification().
import { useNotification } from './NotificationProvider';
const Example = () => {
const { notify } = useNotification();
return (
<button onClick={() => notify('Saved successfully')}>
Save
</button>
);
};You can use optional parameters: notify(message, duration?, icon?)
notify(
message: string,
duration?: number, // default: 3000ms
icon?: string | { default: string }
)notify('New message received', 5000, bell);- Uses Framer Motion.
- Notifications enter from the right.
- Exit by sliding back out.
- Default timeout:
3000ms. - On dismiss, the notification animates out and is removed after
500ms.
- Each notification is draggable horizontally.
- Dragging to the right triggers dismissal.
If you trigger the same notification again within 1 second:
- It will not be shown twice.
- This prevents message spam during rapid repeated actions.
Thank you for visiting the webOS Wiki! We hope this documentation helps you navigate, understand, and extend the project effectively.
Contact: Reach out via LinkedIn.
Happy coding! 🚀