Example. Simple Text Modal
Launch an empty modal
BSDialog.Show({ ID: "modalL1", Title: "Modal Title", Message: "Hello Momo!", URL: null, Size: "md", Colour: "secondary" });
Example. Prompt Modal
Launch a prompt modal and wait for a response
let response = await BSDialog.Prompt({ Title: "Modal Title", Message: "Are you sure want to wait for a response?", Size: "md", Buttons: [ { Label: "Yes", Value: "Yes", Colour: "primary" }, { Label: "No", Value: "No", Colour: "secondary" }, { Label: "Cancel", Value: "Cancel", Colour: "secondary" } ] }); alert(response);
Example. Multiple Modals
Launch multiple modals
BSDialog.Show({ ID: "modalL3a", Title: "Modal A Title", Message: "First!", URL: null, Size: "md", Colour: "secondary" }); BSDialog.Show({ ID: "modalL3b", Title: "Modal B Title", Message: "Second!", URL: null, Size: "md", Colour: "secondary" });
Example. Simple Text Modal Deprecated
Launch an empty modal
BSDialog.Create('abc123', 'My Modal Box 123', 'Hello momo!', 'xl');
Example. Empty Modal and Updates. Deprecated
Launch an empty modal then update its title, body, footer and size.
BSDialog.Create('abc123', 'My Modal Box 123', null, 'sm'); BSDialog.UpdateTitle('abc123', 'My Modal Box 567'); BSDialog.UpdateBody('abc123', 'Help, I\'m toast!'); BSDialog.UpdateFooter('abc123', ''); BSDialog.UpdateSize('abc123', 'lg');
Example. Toast Modal. Deprecated
Show a toast-style modal
BSDialog.ShowToast('abc123', 'My Modal Box 123', 'Help! I\'m toast.', 'sm');