Go Main page
Go Main page

Web components

cover

components

Modal

v.1.0.0 | Saturn

Import

12345678910
import { Modal } from '@kubit-ui-web/react-components';
<Modal
  variant="DEFAULT"
  title={{ content: 'Title', variant: 'HEADING_H4_EXPANDED' }}
  content="Content"
  open={true}
  footer={{
    variant: 'DEFAULT',
  }}
  popover={{

Props

Let's delve into the versatility of the modal component by examining its available props:

Note that the modal component's default styling properties can be moderately adjusted through the ctv an cts props, in case the project do not need a full variant customization. This limited customization ensures a seamless balance between predefined aesthetic and your specific design requirements. Additionally, it's essential to highlight that Kubit always provided the option to full customized all the variants that your project needs.

Uncontrolled

PropertyDescriptionTypeDefault
variant
Required
Variant of modalString-
portalIdId used for Portal createdstring-
onCloseFunction trigger when close modal icon is pressed() => void-
maxHeightMaximum height of the modalString-
minHeightMinimum height of the modalString-
maxWidthMaximum width of the modalString-
minWidthMinimum width of the modalString-
minContentHeightMinimum height of the content modalString-
customHeightAllDevicesActive custom height for all DevicesBooleanfalse
customWidthAllDevicesActive custom width for all DevicesBooleanfalse
idString used for modal idString-
openIndicates if modal is open or notBoolean-
popoverObject to configure the popover in case it is necessaryModalPopoverType-
blockedIf it is true, the component won't be closed by clicking outsideBoolean-
titleTitle of the modalModalTitleTextType-
closeIconIcon to close the modalIElementOrIcon-
closeTextButton to close ModalModalButtonType-
imageIllustrationHeaderModal header illustrationIElementOrillustration-
imageHeaderImage in modal headerIElementOrIcon-
contentThis will appear in your modalReactNode-
footerFooter of the modalModalFooterType-
animationExecutionCssAnimation execute optionCssAnimationExecuteOption-
onKeyDownFunction trigger when key is pressedKeyboardEventHandler-
dataTestIdTest id of the modal. Internal components will concatenate from this test idStringmodalDataTestId
ctvModify styles for the default version of the componentModalBaseStylesType-

Controlled

PropertyDescriptionTypeDefault
variant
Required
Variant of modalString-
portalIdId used for Portal createdstring-
maxHeightMaximum height of the modalString-
minHeightMinimum height of the modalString-
maxWidthMaximum width of the modalString-
minWidthMinimum width of the modalString-
minContentHeightMinimum height of the content modalString-
customHeightAllDevicesActive custom height for all DevicesBooleanfalse
customWidthAllDevicesActive custom width for all DevicesBooleanfalse
idString used for modal idString-
openIndicates if modal is open or notBoolean-
popoverObject to configure the popover in case it is necessaryModalPopoverType-
blockedIf it is true, the component won't be closed by clicking outsideBoolean-
titleTitle of the modalModalTitleTextType-
closeIconIcon to close the modalIElementOrIcon-
closeTextButton to close ModalModalButtonType-
imageIllustrationHeaderModal header illustrationIElementOrillustration-
imageHeaderImage in modal headerIElementOrIcon-
contentThis will appear in your modalReactNode-
footerFooter of the modalModalFooterType-
animationExecutionCssAnimation execute optionCssAnimationExecuteOption-
onKeyDownFunction trigger when key is pressedKeyboardEventHandler-
dataTestIdTest id of the modal. Internal components will concatenate from this test idStringmodalDataTestId
ctvModify styles for the default version of the componentModalBaseStylesType-