egui-modal-0.1.1 has been yanked.
egui-modal, a modal library for egui
usage:
let modal = new;
// What goes inside the modal
modal.show;
if ui.button.clicked
eguilet modal = Modal::new(ctx, "my_modal");
// What goes inside the modal
modal.show(|ui| {
modal.title(ui, "My 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();
}