Modal
A modal works best for focusing users' attention on a short amount of content and getting them to make a decision, such as a
confirmation. Use it to temporarily interrupt a user’s current task and block interactions to the content below it.If your modal content is more complex, or requires considerable time to complete, consider using an EuiFlyout instead.
Each EuiModal requires a specific set of nested child components. They can be omitted if necessary, but the order cannot be changed or interrupted.
Modals come a wrapping EuiOverlayMask to obscure the content beneath, but unlike flyouts, modals cannot be dismissed by clicking on the overlay mask. This is inline with our modal usage guidelines which requires there to be a primary action button, even if that button simply closes the modal.
Forms in a modal
Since the child components of EuiModal are required to be in a specific order, you can only wrap the contents within EuiModalBody with the
<form />
element. You can then hook up your submit button inside EuiModalFooter by adding the id
of the <form />
element to the form
prop of the button.
Widths
Modals start with a minimum width of 400px
, just enough to display form rows. They will grow to fit the contents until it reaches the specified maxWidth
, the default of which is set to the medium breakpoint.
If the modal is not growing wide enough to fit your contents, you can pass a specific style.width
, just remember that modals will always shrink to fit the window width.