# egui-modal, a modal library for [`egui`](https://github.com/emilk/egui)
[](https://crates.io/crates/egui-modal/0.1.1)
[](https://docs.rs/egui-modal/0.1.1/egui_modal/)
[](https://github.com/n00kii/egui-modal/blob/main/README.md)

## usage:
```rust
let modal = Modal::new(ctx, "my_modal");
// What goes inside the modal
modal.body(ui, "This is a modal");
modal.buttons(ui, |ui| {
// After clicking, the modal is automatically closed
if modal.button("A button").clicked() {
println!("Hello world!")
};
});
});
if ui.button("Open the modal").clicked() {
// Show the modal
modal.open();
}
```