-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add gr.Modal component to core Gradio #8875
Comments
Hi @dwipper there is a Gradio custom component
See here on how to use in your gradio app: https://huggingface.co/spaces/aliabid94/gradio_modal I do think its a good idea to bring this into core though, so tagging @aliabid94 |
@abidlabs @aliabid94 Thanks! That works great! I played around with it a bit. Since it appears to close on mouse-click outside the modal and escape in addition to the "X", it would be helpful to have a param that optionally pops up a "Are you sure you want to close" type message. While the standard modal uses the full viewport, I tried a bunch of CSS mods to come up with more of a confirmation style modal. Without specifying specific pixels sizes (which can be problematic) the modals looked pretty wonky. Wondering if there could be a param that either goes 100% or shrinks to fit the layout/components? |
Closing as we decided against adding |
@abidlabs Totally understand. I've had a developer upgrade the component to handle a variety of use cases: https://pypi.org/project/gradio-modal-component . It features various controls, including controlling when the modal closes, a close message, and close styling, control over blur, background transparency, height, and width. |
@cims-ai link broken |
@ROBERT-MCDOWELL Sorry, we had some bugs with the component, and it's not compatible with Gradio 5.0, so we pulled it.... |
ah ok. |
Is your feature request related to a problem? Please describe.
Except for the gr.Info, gr.Error, gr.Warning components, there is no native ability to pop open a modal window to gather user input, i.e. "Continue Yes/No", "Submit - Are you sure?", "Delete record - Are you sure?"
Describe the solution you'd like
While a simple solution would be to have a "gr.Confirm" component that would have hardwired Yes/No buttons, a cooler solution would be to have a gr.Modal component that could display one or more components, i.e. gr.Dropdown, gr.Textbox, gr.Radio, etc. Being able pass the gr.Model a full gr.Blocks layout would be really great.
Additional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered: