Modal - Aspect UI

The Modal component displays content in a dialog overlay. It supports animations, accessibility, focus trapping, close buttons, and scroll locking for focused user interactions.

Table of Contents#


PropTypeDefaultDescription
childrenReactNode-Content inside the modal, typically ModalAction and ModalContent components.
isOpenExternalboolean-Controls whether the modal is open (controlled mode).
onToggle(isOpen: boolean) => void-Callback fired when the modal open state changes.

ModalAction Props#


PropTypeDefaultDescription
childrenReactNode-Content of the modal action button.
classNamestring''Additional CSS classes for the action button.
...restButtonHTMLAttributes<HTMLButtonElement>-Any other native button attributes passed to the action button.

ModalContent Props#


PropTypeDefaultDescription
childrenReactNode-Content inside the modal content container.
classNamestring''Additional CSS classes for the modal content container.
overlayClassNamestring''Additional CSS classes for the modal overlay background.
...restHTMLAttributes<HTMLDivElement> & MotionProps-Additional HTML and animation props passed to the modal content container.