Skip to main content

ModalWrapper

A styled MUI Dialog with a consistent header, close button, and body scroll behaviour. Use it as the base for all application modals.

πŸ“– Storybook

Preview​

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​

PropTypeDefaultDescription
openbooleanβ€”Controls modal visibility
onClose() => voidβ€”Called when the user dismisses the modal
titlestringβ€”Modal header title
maxWidth"xs" | "sm" | "md" | "lg" | "xl""md"Maximum modal width
fullWidthbooleantrueExpand to maxWidth
childrenReactNodeβ€”Modal body content
actionsReactNodeβ€”Footer action area (outside children scroll)
sxSxProps<Theme>β€”Root style overrides

See also​