useDialog
Description
Section titled “Description”Hook to be used with Overlay to handle the opening and closing of the dialog
Component
Section titled “Component”Properties
Section titled “Properties”id: A string referencing the dialogisModal: A boolean. Iftrue, show the dialog as a modalonSubmit: A function that is triggered when the dialog is closing
Attribute
Section titled “Attribute”reference: The reference of the dialogproperties: The properties of the dialog
Methods
Section titled “Methods”-
softClose(): Close the dialog -
openOverlay(): Open the dialog
Implementation example
Section titled “Implementation example”const dialog = useDialog({ id: 'overlay', isModal: true, onSubmit: () => alert('The dialog has been closed'),});
dialog.openOverlay();
dialog.softClose();