Happeo UIkit logo
Components
Home
Packages
AlertsAvatarBannersBreadcrumbsButtonsButtonsDS3CardColor PickerColorsContent RendererEmojisFile IconFile PickerForm ElementsIcons AppIcons FileIcons FlagIcons LegacyIcons SymbolImage CarouselImage CropperImage GridLayoutListLoadersMenusModalsModalConfirmModalExamplesNavigationThemeToastTypography

Modal

ConfirmModal

isOpen
boolean
close
() => void
() => {}
bodyText
string
header
ReactNode
okCb
() => void
() => {}
id
string | undefined
hideCancel
boolean | undefined
state
MODAL_STATES
MODAL_STATES.success
btnDisabled
boolean | undefined
okText
string
OK
cancelText
string
Cancel
width
string | undefined
350px
closeOnClickOutside
boolean | undefined
closeOnEsc
boolean | undefined
autoFocusCancel
boolean | undefined
autoFocusOk
boolean | undefined
dataTracker
string | undefined

Examples

Success ConfirmModal

Info ConfirmModal

Warn ConfirmModal

Alert ConfirmModal

Alert ConfirmModal with custom body

Make sure to provide both close function and iconClose={true}

Customize modal with anything inside. Here's an example to have a custom footer.

If you provide the closeOnClickOutside prop, the modal will automatically close when you click outside of it.

If you provide the prop reactModalProps to Modal component:

// reactModalProps = {{
// onRequestClose: () => {close();},
// shouldCloseOnOverlayClick: true
// }}

The modal will automatically close when you click on backdrop of it. Top left of the screen there is a portal on which you can click and see that modal does not close

When closeOnClickOutside is usedModal that closes when you click on something that is not in modal root Top left of the screen there is a portal on which you can click and see that modal does close

// closeOnClickOutside
const closeOnClickOutside=true;