https://github.com/ItsEthra/egui-notify
Notifications library for egui
https://github.com/ItsEthra/egui-notify
gui notifications rust toast
Last synced: 3 months ago
JSON representation
Notifications library for egui
- Host: GitHub
- URL: https://github.com/ItsEthra/egui-notify
- Owner: ItsEthra
- License: mit
- Created: 2022-08-22T21:18:04.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2025-02-07T13:00:51.000Z (5 months ago)
- Last Synced: 2025-03-08T00:23:46.460Z (4 months ago)
- Topics: gui, notifications, rust, toast
- Language: Rust
- Homepage:
- Size: 291 KB
- Stars: 134
- Watchers: 1
- Forks: 39
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- awesome-egui - egui notify
README
# egui-notify
Simple notifications library for [`egui`](https://github.com/emilk/egui)


## Usage
```rust
use egui_notify::Toasts;
use std::time::Duration;// initialize once
let mut toasts = Toasts::default();
``````rust
// somewhere within [egui::App::update]...
toasts.info("Hello world!").duration(Duration::from_secs(5));
// ...
toasts.show(ctx);
```## Installation
```sh
cargo add egui-notify
``````toml
[dependencies]
egui-notify = "0.17.0"
```## Difference to [`egui-toast`](https://github.com/urholaukkarinen/egui-toast)
### `egui-notify` has
- Animations for appearing/disappearing toasts
- Duration meter for expiring toasts
- Toast positioning not influenced by which `Context` you pass to it (like if for example, you passed in a `Context` already altered for an `egui::Window`)
- Differing methodology (create `Toasts` instance once, save save somewhere in application state)
- Threadsafe `Toasts` instance, implements `Send`, `Sync`.
- No support for custom toasts