Skip to content

⚙️ Global Configuration: Popup Settings

These settings can be applied to any popup (native or custom). You can set them globally in config.defaultSettings (see Provider Props) or pass them directly to openPopup.

PropertyTypeDefaultDescription
idstringautoUnique popup ID (It is not recommended to change)
closeOnEscapebooleantrueClose on ESC key
closeOnClickOutsidebooleantrueClose on backdrop click
requireActionbooleanfalseRequires internal action to close
timeoutnumber0Auto-close after milliseconds
keepLastbooleanfalseKeep previous popup visible
allowPageBodyScrollbooleanfalseAllow page scrolling
interactiveBackdropbooleanfalseAllow backdrop interactions
hiddenBackdropbooleanfalseHide backdrop
hiddenHeaderbooleanfalseHide header
hiddenFooterbooleanfalseHide footer
disableAnimationbooleanfalseDisable open/close animation
maxWidthstring-CSS max-width (e.g., '800px')
minWidthstring-CSS min-width (e.g., '200px')
onOpen(id: string) => void-Callback on open
onClose(hasAction: boolean, id: string) => void-Callback on close

Example (in openPopup):

jsx
openPopup('generic', {
  closeOnEscape: false,
  requireAction: true,
  timeout: 5000,
  maxWidth: '400px',
  onOpen: (id) => console.log('Opened:', id),
  onClose: (hasAction, id) => {
    console.log('Closed with action?', hasAction);
  },
  data: {
    message: 'Auto-closes in 5 seconds'
  }
});