Bad GUI is a tiny GUI library for the web. It includes ready to use components like prompts, alerts and sliders.
Bad gui does only generates the DOM structure for you but provides no styling or design. You are responsible for the CSS.
Embed badgui.js in your HTML file:
<script src="https://example.com/badgui.js"></script>const prompt = new badgui.prompt('Save', 'Please enter a name for the document', {
inputs: [{
label: 'Name', type: 'text', name: 'name'
}],
buttons: [{
label: 'Cancel', action: function() {
this.close();
}
}, {
label: 'Save', action: function() {
sendToServer(this.data());
this.close();
}
}]
});
prompt.open();