Skip to main content

Modal

@shopify/shop-minis-platform-sdk / components/Modal

Renames and re-exports HEADER_HEIGHT

Renames and re-exports HEADER_ICON_LEFT_BOUNDING_BOX

Renames and re-exports HEADER_ICON_RIGHT_BOUNDING_BOX

ModalHeaderLayoutVariant

ModalHeaderLayoutVariant: "solid" | "overlay"


Modal(__namedParameters): Element

A modal component with an animated entrance/exit.

Parameters

ParameterType
__namedParametersModalProps

Returns

Element

Deprecated

use useSheet instead

The height of the modal can either reflect the size of the given children or a fixed height can be set. When using auto sizing you must be careful to never pass so much content to overflow on small screen sizes.

When paired with <ModalScrollView /> the children can scroll.

Component

Example

const [isOpen, setIsOpen] = useState(false)

return (
<>
<Button
text="Open Modal"
disabled={isOpen}
onPress={() => setIsOpen(true)}
/>
<Modal isOpen={isOpen} onDismiss={() => setIsOpen(false)}>
<SomeContent />
</Modal>
</>
)

ModalSafeArea()

ModalSafeArea(__namedParameters): Element

Parameters

ParameterType
__namedParametersModalSafeAreaProps & BackgroundColorProps\<object> & OpacityProps\<object> & VisibleProps\<object> & LayoutProps\<object> & SpacingProps\<object> & object & object & object & object & object & object & object & Omit\<ViewProps & object, "width" | "height" | "borderRadius" | "minWidth" | "maxWidth" | "minHeight" | "maxHeight" | "overflow" | "aspectRatio" | "alignContent" | "alignItems" | "alignSelf" | "justifyContent" | "flex" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "marginHorizontal" | "marginVertical" | "marginStart" | "marginEnd" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingHorizontal" | "paddingVertical" | "paddingStart" | "paddingEnd" | "columnGap" | "rowGap" | "gap" | "borderBottomWidth" | "borderLeftWidth" | "borderRightWidth" | "borderStyle" | "borderTopWidth" | "borderStartWidth" | "borderEndWidth" | "borderWidth" | "borderColor" | "borderTopColor" | "borderRightColor" | "borderLeftColor" | "borderBottomColor" | "borderStartColor" | "borderEndColor" | "borderBottomLeftRadius" | "borderBottomRightRadius" | "borderTopLeftRadius" | "borderTopRightRadius" | "borderBottomStartRadius" | "borderBottomEndRadius" | "borderTopStartRadius" | "borderTopEndRadius" | "shadowOpacity" | "shadowOffset" | "shadowRadius" | "elevation" | "position" | "top" | "right" | "bottom" | "left" | "start" | "end" | "backgroundColor" | "opacity" | "visible" | "shadowColor" | "zIndex"> & RefAttributes\<unknown>

Returns

Element

Component

When using <Modal headerLayoutVariant="overlay" /> you can use this component to avoid accidentally overflowing and overlapping the icons