Kaupvik KeelKaupvik Keel
Open Source · v0.6.5

Native overlay

Inline Polaris modal with reliable close, focus and scroll restoration.

Interactive example

Loading Polaris web components…

Usage

<NativeOverlay heading="Confirm changes" onClose={close}><s-paragraph>Review the change before saving.</s-paragraph><s-button slot="secondary-actions" onClick={closeNative}>Cancel</s-button></NativeOverlay>

Properties

PropertyTypeDefaultDescription
headingstringRequiredAccessible native dialog title.
childrenReactNodeRequiredNative content and native action slots.
onClose()=>voidRequiredUnmount after the native afterhide lifecycle.
sizebase | small | largebaseNative modal size.
modalRefRefObject<HTMLElement|null>—Optional host reference; call public hideOverlay to close.

Design & interaction

An inline app modal, not an App Bridge separate-frame modal. No business calls or credentials. Prefer public show/hide; isolate the verified App Bridge delegation compatibility and a bounded private dismissal fallback. Do not close the shadow dialog directly. Previous versions remain immutable.

Accessibility

Native focus trap, Escape/header dismissal and focus return. onClose runs once after afterhide. Consumer must test absence of inert/scroll/overlay residue and keyboard reopening in its actual Shopify host.

Open-source source

Available in github.com/Kaupvik/kaupvik-polaris ↗. Host apps supply authentication, native persistence, and read-back state.