Skip to content

useDialog

Hook to be used with Overlay to handle the opening and closing of the dialog

  • id: A string referencing the dialog
  • isModal: A boolean. If true, show the dialog as a modal
  • onSubmit: A function that is triggered when the dialog is closing
  • reference : The reference of the dialog
  • properties : The properties of the dialog
  • softClose() : Close the dialog

  • openOverlay() : Open the dialog

const dialog = useDialog({
id: 'overlay',
isModal: true,
onSubmit: () => alert('The dialog has been closed'),
});
dialog.openOverlay();
dialog.softClose();