Install Asset
Install via Godot
To maintain one source of truth, Godot Asset Library is just a mirror of the old asset library so you can download directly on Godot via the integrated asset library browser
![HTML5 Popups hero image](https://img.godotassetlibrary.com/_gzSWd5pdo2hzshDgyLZkcCVc6kA4Y5-ov4EjiIHT7k/rs:fit:1920:1080:0/g:no/aHR0cHM6Ly9naXRsYWIuY29tL21vY2NoYXBpL2dvZG90LTQtaHRtbDUtcG9wdXBzLy0vcmF3L21haW4vYWRkb25zL2h0bWw1X3BvcHVwcy9pY29ucy9pY29uLnBuZw.webp)
Quick Information
![HTML5 Popups icon image](https://img.godotassetlibrary.com/IUlXxgTjTAxOa81GA7U4aUB6RngdvJZJCqnEZ2WgEko/rs:fit:50:50:0/g:no/aHR0cHM6Ly9naXRsYWIuY29tL21vY2NoYXBpL2dvZG90LTQtaHRtbDUtcG9wdXBzLy0vcmF3L21haW4vYWRkb25zL2h0bWw1X3BvcHVwcy9pY29ucy9pY29uLnBuZw.webp)
Adds simple "OK", "Yes/No", and text input popups for web exportsView full documentation on gitlab or inside godot
HTML5 Popups (for godot 4)
Godot 4 addon that adds javascript alert()
, confirm()
, and prompt()
popups for web exports.
Note that displaying any of these popups will freeze the project until they are dismissed!
Also keep in mind that the browser may give the option to disallow the page from showing more popups.
Also also, this addon obviously only works on web exports.
Usage through nodes
HTML5AcceptDialog
Simple popup which displays some text and has a single "ok" button to dismiss it.
Properties:
dialog_text:String
: The text to display in the popup
Signals:
done()
: emitted when the popup is dismissed
Functions:
show()->null
: display the popup
HTML5ConfirmationDialog
A popup with "yes/okay" and "no/cancel" buttons (actual button text may vary between browsers).
Properties:
dialog_text:String
: The text to display in the popup
Signals:
canceled()
: The popup was dismissed or the "no/cancel" button was pressedconfirmed()
: The "yes/okay" button was presseddone(result:bool)
: Triggers both if the popup was canceled or confirmed, withresult
astrue
if it was confirmed, andfalse
otherwise
Functions:
show()->bool
: display the popup (return value is the same as thedone()
signal)
HTML5InputDialog
A popup with a text input field, similar to a LineEdit. It also has the "yes/okay" and "no/cancel" buttons.
Properties:
dialog_text:String
: The text to display in the popupdefault_value:String
: A pre-filled value for in the input field
Signals:
canceled()
: The popup was dismissed or the user entered an empty string (""
)confirmed(text:String)
: The user entered some text & pressed "yes/okay"done(result:String)
: Triggers both if the popup was canceled or confirmed, withresult
as the entered text if it was confirmed, and and empty string (""
) otherwise
Functions:
show()->string
: display the popup (return value is the same as thedone()
signal)
Usage through HTML5Popups
If you prefer not to use nodes, you can use the HTML5Popups
static class to summon all the same popups as with the nodes.
Functions (static):
accept_dialog(text:String)->null
: Summon the HTML5AcceptDialog node popupconfirmation_dialog(text:String)->bool
: Summon the HTML5ConfirmationDialog node popupinput_dialog(text:String, default_value:String="")->String
: Summon the HTML5InputDialog node popup
You can also use the Javascript names instead:
alert(text:String)->null
: same asaccept_dialog
confirm(text:String)->bool
: same asconfirmation_dialog
prompt(text:String, default_value:String="")->String
: same asinput_dialog
Adds simple "OK", "Yes/No", and text input popups for web exports
View full documentation on gitlab or inside godot
Reviews
Quick Information
![HTML5 Popups icon image](https://img.godotassetlibrary.com/IUlXxgTjTAxOa81GA7U4aUB6RngdvJZJCqnEZ2WgEko/rs:fit:50:50:0/g:no/aHR0cHM6Ly9naXRsYWIuY29tL21vY2NoYXBpL2dvZG90LTQtaHRtbDUtcG9wdXBzLy0vcmF3L21haW4vYWRkb25zL2h0bWw1X3BvcHVwcy9pY29ucy9pY29uLnBuZw.webp)
Adds simple "OK", "Yes/No", and text input popups for web exportsView full documentation on gitlab or inside godot