This library is still in development and is available only for internal usage at VTEX.
Skip to main content

Modal

Modal

Version: Next

Modal

Modal containers allow merchants to view content that demands attention through an overlay window that opens on top of the current page.

The Modal is composed by many parts: Modal, ModalHeader, ModalTitle, ModalDismimiss, ModalContent, ModalFooter, and ModalButton.

The main component, responsible for holding the state.

ModalHeader

The header gives the modal context, its usually composed by the ModalTitle and ModalDismiss.

ModalTitle

Modal heading component.

ModalDismiss

Dismisses the modal.

ModalContent

The ModalContent is the main part of the modal.

ModalFooter

The footer usually contains actions.

Abstracting

The main reason the modal is composable is to enable abstractions. You can create specific modals using the small pieces admin-ui provides. In the example, you can see a confirmation modal that uses this approach:

Styling

Every modal component can receive a className to customize styling.