Base modal
Examples
Basic
Basic
Nest
Nest.
Disable mask close
Disable close modal when click mask layer.
Hide mask
Hide mask.
Disable esc close
Disable close modal when press key esc.
Shortcut
Support the focus of the internal Popper element. Note that the Popper is actually hung on the body, but the Tab key can work as expected.
Properties
| Property | Description | Type | Default | Require |
|---|---|---|---|---|
| container | Specify the parent container of the modal | string | HTMLElement | (() => string | HTMLElement) | - | false |
| defaultOpen | Whether the default modal is displayed, when open exists, the option is invalid | boolean | false | false |
| onOpenChange | Callback when the status of the modal changes | (open: boolean) => void | - | false |
| open | Whether to show modal | boolean | - | false |
| unmountOnHide | Destroy dom when close modal | boolean | - | false |
| mountOnShow | Mount dom when open modal | boolean | true | false |
| mask | Whether show modal layer | boolean | true | false |
| maskClosable | Whether close modal when click mask layer | boolean | true | false |
| escClosable | Whether close modal when press key esc | boolean | true | false |
| wrapperClassName | Modal wrapper className | string | - | false |
| onAfterClosed | The hook when modal closed. At this time, modal animation ends too | () => void | - | false |