Theme

npm_versionnpm Paragon package page

Alert Dialogs are used to block the user from moving forward in a particular workflow with a quick message that requires agreement before the action or next step can be taken. An example is providing a warning that settings may not be updated if the user has not chosen to save their changes.

This is the alert style ModalDialog composition. AlertModal passes all of its props through to an underlying ModalDialog component providing some limited customization. If you have unique needs, use the ModalDialog compound component family directly.

Basic usage

Any Paragon component or export may be added to the code example.

Variants

Any Paragon component or export may be added to the code example.

Any Paragon component or export may be added to the code example.

Any Paragon component or export may be added to the code example.

Theme Variables#

CSS VariableComputed Value










Props API#

AlertModal Props API
  • children node Required
  • title string Required

    The aria-label of the dialog

  • isOpen bool

    Is the modal dialog open or closed

    Defaultfalse
  • isBlocking bool

    Prevent clicking on the backdrop or pressing Esc to close the modal

    Defaultfalse
  • hasCloseButton bool

    Specifies whether the dialog box should contain 'x' icon button in the top right

    Defaultfalse
  • onClose requiredWhenNot(PropTypes.func, 'isBlocking')

    A callback to close the modal dialog

    Default() => {}
  • size enum'sm' | 'md' | 'lg' | 'xl' | 'fullscreen'

    Sizes determine the maximum width of the dialog box

    Default'md'
  • variant enum'default' | 'warning' | 'danger' | 'success'

    The visual style of the dialog box

    Default'default'
  • closeLabel string

    The label supplied to the close icon button if one is rendered

    Default'Close'
  • className string

    Specifies class name to append to the base element

  • isFullscreenScroll bool

    Determines where a scrollbar should appear if a modal is too large for the viewport. When false, the ModalDialog.Body receives a scrollbar, when true the browser window itself receives the scrollbar.

    Defaultfalse
  • footerNode node

    Specifies what should be displayed in the footer of the dialog box

    Defaultnull
  • icon elementType

    Icon that will be shown in the header of modal

ModalDialog Props API
  • children node Required

    Specifies the content of the dialog

  • title string Required

    The aria-label of the dialog

  • onClose func Required

    A callback to close the modal dialog

  • isOpen bool

    Is the modal dialog open or closed

    Defaultfalse
  • hasCloseButton bool

    The close 'x' icon button in the top right of the dialog box

    Defaulttrue
  • size enum'sm' | 'md' | 'lg' | 'xl' | 'fullscreen'

    Sizes determine the maximum width of the dialog box

    Default'md'
  • variant enum'default' | 'warning' | 'danger' | 'success' | 'dark'

    The visual style of the dialog box

    Default'default'
  • closeLabel string

    The label supplied to the close icon button if one is rendered

    Default'Close'
  • className string

    Specifies class name to append to the base element

  • isFullscreenScroll bool

    Determines where a scrollbar should appear if a modal is too large for the viewport. When false, the ModalDialog. Body receives a scrollbar, when true the browser window itself receives the scrollbar.

    Defaultfalse
  • isFullscreenOnMobile bool

    To show full screen view on mobile screens

    Defaultfalse
  • isBlocking bool

    Prevent clicking on the backdrop or pressing Esc to close the modal

    Defaultfalse
  • zIndex number

    Specifies the z-index of the modal

  • isOverflowVisible bool

    Specifies whether overflow content inside the modal should be visible.

    • true - content that exceeds the modal boundaries will remain visible outside the modal's main viewport, rather than being clipped or hidden.
    • false - any overflow content will be clipped to fit within the modal's dimensions.
    Defaulttrue

Usage Insights#

AlertModal

Project NameParagon VersionInstance Count
frontend-app-account22.10.01
frontend-app-admin-portal21.13.113
frontend-app-communications22.7.01
frontend-app-course-authoring22.8.111
frontend-app-discussions22.7.01
frontend-app-ecommerce20.46.31
frontend-app-learner-portal-enterprise21.13.18
frontend-app-learning22.10.01
frontend-app-library-authoring21.11.31
frontend-app-ora-grading21.11.32
frontend-app-support-tools21.13.11

ModalDialog

Project NameParagon VersionInstance Count
frontend-app-account22.10.04
frontend-app-admin-portal21.13.125
frontend-app-authn22.11.22
frontend-app-communications22.7.01
frontend-app-course-authoring22.8.119
ora_settings22.8.11
proctoring22.8.11
xpert_unit_summary22.8.11
frontend-app-discussions22.7.02
frontend-app-enterprise-public-catalog21.13.12
frontend-app-gradebook22.8.11
frontend-app-learner-dashboard22.9.05
frontend-app-learner-portal-enterprise21.13.13
frontend-app-learner-record22.10.01
frontend-app-learning22.10.04
frontend-app-library-authoring21.11.33
frontend-app-payment22.9.02
frontend-app-publisher21.13.11
frontend-app-support-tools21.13.116
frontend-lib-special-exams22.7.01
prospectus20.46.23