npx gluestack-ui add modalimport {
Modal,
ModalBackdrop,
ModalContent,
ModalHeader,
ModalCloseButton,
ModalBody,
ModalFooter,
} from '@/components/ui/modal';


export default () => (
<Modal>
<ModalBackdrop />
<ModalContent>
<ModalHeader>
<ModalCloseButton></ModalCloseButton>
</ModalHeader>
<ModalBody />
<ModalFooter />
</ModalContent>
</Modal>
);
| Prop | Type | Default | Description |
|---|---|---|---|
isOpen | boolean | - | If true, the modal will open. Useful for controllable state behavior |
onClose | () => any | - | Callback invoked when the modal is closed |
useRNModal | boolean | false | If true, renders react-native native modal |
defaultIsOpen | boolean | - | Specifies the default open state of the Modal |
initialFocusRef | React.RefObject<any> | - | The ref of element to receive focus when the modal opens |
finalFocusRef | React.RefObject<any> | - | The ref of element to receive focus when the modal closes |
avoidKeyboard | boolean | - | If true, the Modal will avoid the keyboard |
closeOnOverlayClick | boolean | - | If true, the Modal will close when the overlay is clicked |
isKeyboardDismissable | boolean | - | If true, the keyboard can dismiss the Modal |
children | any | - | The content to display inside the Modal |
| Prop | Type | Default | Description |
|---|---|---|---|
focusable | boolean | false | If true, Modal Content will be focusable |
| Name | Value | Default |
|---|---|---|
size | xs | sm | md | lg | full | md |