Modal Component
@shopify/app-bridge-react@v4
and the app-bridge.js
script tagThe Modal API allows you to display an overlay that prevents interaction with the rest of the app until dismissed.
It is used by customizing your Modal content with the Modal
component and then opening it with the shopify.modal.show('modal-id')
API.
Anchor to modal componentModal component
The Modal
component is available for use in your app. It configures a Modal to display in the Shopify Admin.
The content you provide can be simple React elements or a src
prop with a URL that will be loaded.
The content to display within a Modal. You can provide a single HTML element with children and the ui-title-bar element to configure the Modal title bar.
A unique identifier for the Modal
The URL of the content to display within a Modal. If provided, the Modal will display the content from the provided URL and any children other than the ui-title-bar and ui-save-bar elements will be ignored.
The size of the modal.
Before the Modal is shown, this can be changed to any of the provided values. After the Modal is shown, this can can only be changed between small
, base
, and large
.
Modal
Preview

Anchor to examplesExamples
Modal options, variations, and events
Anchor to example-modals-with-different-optionsModals with different options
Anchor to example-opening-a-max-size-modalOpening a max size Modal
Modal with max size
Anchor to example-specifying-a-modal-sizeSpecifying a Modal size
Modal with variant
Anchor to example-specifying-a-title-for-the-modalSpecifying a title for the Modal
Modal with title
Anchor to example-adding-primary-and-secondary-actions-to-a-modalAdding primary and secondary actions to a Modal
Modal with primary and secondary actions
Anchor to example-using-a-modal-for-a-destructive-actionUsing a modal for a destructive action
Adding a critical button to a Modal
Opening a max size Modal
Preview

Anchor to example-modal-eventsModal events
Anchor to example-subscribing-to-showSubscribing to Show
Using the callback which is called when the Modal is opened
Anchor to example-subscribing-to-hideSubscribing to Hide
Using the callback which is called when the Modal is closed
Subscribing to Show
Anchor to example-modal-controlsModal controls
Anchor to example-showing-a-modal-with-the-`open`-propShowing a Modal with the `open` prop
Modal controlled by the open
prop
Showing a Modal with the `open` prop
Anchor to example-using-a-src-url-to-load-contentUsing a src URL to load content
Anchor to example-loading-content-from-a-urlLoading content from a URL
Loading content from a URL
Anchor to example-communicating-between-the-modal-and-the-parent-windowCommunicating between the Modal and the parent window
Communicating between the Modal and the parent window
Anchor to example-opening-a-base-modal-within-a-max-src-modalOpening a base modal within a max src modal
This pattern is useful for displaying a dialog or prompt from within a max variant modal.