The title of the dialog. Can be a JSX element.
The text of the submit button.
Optional
submitThe CSS class of the submit button.
Optional
cancelThe text of the cancel button. Defaults to "Cancel".
Optional
submitAllows you to disable the submit button even if getSubmitEnabled()
would return true.
This can be useful if you want to disable the submit button while a query is in progress.
A boolean indicating if the form is valid.
A boolean indicating if validation feedback is being shown.
Optional
closeThis prop accepts a ref object that holds a function of type () => void
. You can execute the function to programmatically close the dialog:
closeRef.current()
Optional
modalThe CSS class added to the underlying Bootstrap modal.
Optional
focusSet to false
to disable the default behavior of focusing the first
input.
Optional
showSet to false
to hide the modal footer, which contains the submit and
cancel buttons.
A callback that fires after the submit
function succeeds.
If the submit
function returned responseData
, it is passed to your
onSuccess
function.
Your onSuccess
callback must return a promise. The submit button will
continue showing a loading indicator until the promise resolves. This is
to support refetching the data that was updated by the form submission.
A callback that fires when the form is submitted. You will typically
perform an API call in your submit
function.
Your submit
function can optionally return an object in the shape
{
shouldClose?: boolean
responseData: unknown
}
Using formData
is deprecated. Use controlled components instead.
formData
will be {}
if the optional peer dependency jquery
is not
installed.
Optional
on
The props type of
EasyFormDialog
.