ModalWrapper
A styled MUI Dialog with a consistent header, close button, and body scroll behaviour. Use it as the base for all application modals.
Previewβ
Live previewβ Open in Storybook
Importβ
import { ModalWrapper } from "@xocialive/ui-components";
Basic usageβ
const { open, onOpen, onClose } = useDisclosure();
<Button onClick={onOpen}>Open modal</Button>
<ModalWrapper
open={open}
onClose={onClose}
title="Edit User"
maxWidth="sm"
>
<UserEditForm onSuccess={onClose} />
</ModalWrapper>
Propsβ
| Prop | Type | Default | Description |
|---|---|---|---|
open | boolean | β | Controls modal visibility |
onClose | () => void | β | Called when the user dismisses the modal |
title | string | β | Modal header title |
maxWidth | "xs" | "sm" | "md" | "lg" | "xl" | "md" | Maximum modal width |
fullWidth | boolean | true | Expand to maxWidth |
children | ReactNode | β | Modal body content |
actions | ReactNode | β | Footer action area (outside children scroll) |
sx | SxProps<Theme> | β | Root style overrides |
See alsoβ
useDisclosureβ hook for open/close stateConfirmationModal