Theme

npm_versionnpm Paragon package page

The standard ModalDialog composition. StandardModal 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.

Theme Variables#

CSS VariableComputed Value










Props API#

StandardModal Props API
  • children node Required

    Specifies the content of the Modal

  • title string Required

    The title for the Modal

  • onClose func Required

    Optional callback function for when the modal it dismissed.

  • isOpen bool

    Is the modal open or closed

    Defaultfalse
  • hasCloseButton bool

    The close 'x' icon button in the top right corner

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

    The modal size

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

    The modal style variant to use

    Default'default'
  • closeLabel string

    Specifies the aria-label attribute for the close button

    Default'Close'
  • className string

    A class name to append to the modal

  • 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 nodal

    Defaultnull
  • beforeBodyNode node

    Specifies what should be displayed before the body block

    Defaultnull
  • afterBodyNode node

    Specifies what should be displayed after the body block

    Defaultnull
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#

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

StandardModal

Project NameParagon VersionInstance Count
frontend-app-course-authoring22.8.12
frontend-app-learner-portal-enterprise21.13.15
frontend-app-learner-record22.10.02
frontend-app-learning22.10.02