{"id":13546923,"url":"https://github.com/n00kii/egui-modal","last_synced_at":"2025-04-04T04:10:48.067Z","repository":{"id":59729762,"uuid":"538621555","full_name":"n00kii/egui-modal","owner":"n00kii","description":"a simple modal library for egui","archived":false,"fork":false,"pushed_at":"2024-09-30T02:49:25.000Z","size":95,"stargazers_count":67,"open_issues_count":3,"forks_count":10,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-15T06:09:30.675Z","etag":null,"topics":["egui","rust","ui"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/n00kii.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-09-19T17:36:02.000Z","updated_at":"2024-10-11T16:53:30.000Z","dependencies_parsed_at":"2023-11-24T23:26:53.271Z","dependency_job_id":"0947bed1-fa66-4610-8566-91af06117e83","html_url":"https://github.com/n00kii/egui-modal","commit_stats":{"total_commits":36,"total_committers":5,"mean_commits":7.2,"dds":0.25,"last_synced_commit":"0faaf637f208e0e4a1ddeadc6a750482a234ce67"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n00kii%2Fegui-modal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n00kii%2Fegui-modal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n00kii%2Fegui-modal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n00kii%2Fegui-modal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/n00kii","download_url":"https://codeload.github.com/n00kii/egui-modal/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247117764,"owners_count":20886439,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["egui","rust","ui"],"created_at":"2024-08-01T12:00:47.980Z","updated_at":"2025-04-04T04:10:48.051Z","avatar_url":"https://github.com/n00kii.png","language":"Rust","funding_links":[],"categories":["Libraries"],"sub_categories":[],"readme":"# egui-modal, a modal library for [`egui`](https://github.com/emilk/egui)\n[![crates.io](https://img.shields.io/crates/v/egui-modal)](https://crates.io/crates/egui-modal)\n[![docs](https://docs.rs/egui-modal/badge.svg)](https://docs.rs/egui-modal/latest/egui_modal/)\n[![license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/n00kii/egui-modal/blob/main/README.md)\n\n![modal](https://raw.githubusercontent.com/n00kii/egui-modal/main/media/modal.png?token=GHSAT0AAAAAABVWXBGJBQSFC3PLQP4KKOG6YZJIDCA)\n\n## normal usage:\n```rust\n/* calling every frame */\n\nlet modal = Modal::new(ctx, \"my_modal\");\n\n// What goes inside the modal\nmodal.show(|ui| {\n    // these helper functions help set the ui based on the modal's\n    // set style, but they are not required and you can put whatever\n    // ui you want inside [`.show()`]\n    modal.title(ui, \"Hello world!\");\n    modal.frame(ui, |ui| {\n        modal.body(ui, \"This is a modal.\");\n    });\n    modal.buttons(ui, |ui| {\n        // After clicking, the modal is automatically closed\n        if modal.button(ui, \"close\").clicked() {\n            println!(\"Hello world!\")\n        };\n    }); \n});\n\nif ui.button(\"Open the modal\").clicked() {\n    // Show the modal\n    modal.open();\n}\n```\n## dialog usage\n![dialog](https://raw.githubusercontent.com/n00kii/egui-modal/main/media/dialog.png)\n\nin some use cases, it may be more convenient to both open and style the modal as a dialog as a one-time action, like on the single instance of a function's return.\n```rust\n/* calling every frame */\n\nlet modal = Modal::new(ctx, \"my_dialog\");\n\n...\n...\n...\n\n// Show the dialog\nmodal.show_dialog();\n```\nelsewhere,\n```rust\n/* happens once */\nif let Ok(data) = my_function() {\n    modal.dialog()\n        .with_title(\"my_function's result is...\")\n        .with_body(\"my_function was successful!\")\n        .with_icon(Icon::Success)\n        .open()\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fn00kii%2Fegui-modal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fn00kii%2Fegui-modal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fn00kii%2Fegui-modal/lists"}