Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
I'm adding a modal to my app and noticed that the old Modal component in Polaris was deprecated so I checked out the `ui-modal` web component in App Bridge. I'm just trying this out and copy-pasted the code from docs but clicking any button under the `ui-title-bar` just crashes the entire app. Here's the code again that I copy-pasted from the docs to my Shopify-Remix template (with some React adjustments like onClick):
<ui-modal id="my-modal">
<p>Message</p>
<ui-title-bar title="Title">
<button variant="primary">Label</button>
<button onClick={() => document.getElementById('my-modal')!.hide()}>Label</button>
</ui-title-bar>
</ui-modal>
<button onClick={() => document.getElementById('my-modal')!.show()}>Open Modal</button>
And what it's like clicking the Dialog buttons:
Solved! Go to the solution
This is an accepted solution.
Hi @nxtdev, For remix, you should use this: https://shopify.dev/docs/api/app-bridge-library/react-components/modal-component
Sale banner, pop ups: Customize your sale banner, pop-ups and create countdown bar to boost conversion rate.
Simicart: Transform your Shopify store into a stunning and fully functional mobile app with just a few simple steps.
Product Labels & Badges: Get more sales with striking labels, badges, and banners from our 10,000+ available templates.
BSS Commerce - Full-service eCommerce Agency | Use Shopify for 1$ in the first month now
This is an accepted solution.
Hi @nxtdev, For remix, you should use this: https://shopify.dev/docs/api/app-bridge-library/react-components/modal-component
Sale banner, pop ups: Customize your sale banner, pop-ups and create countdown bar to boost conversion rate.
Simicart: Transform your Shopify store into a stunning and fully functional mobile app with just a few simple steps.
Product Labels & Badges: Get more sales with striking labels, badges, and banners from our 10,000+ available templates.
BSS Commerce - Full-service eCommerce Agency | Use Shopify for 1$ in the first month now
Cool, thanks for pointing this out! I'm new to Remix, still figuring things out.
Learn how to expand your operations internationally with Shopify Academy’s learning path...
By Shopify Feb 4, 2025Hey Community, happy February! Looking back to January, we kicked off the year with 8....
By JasonH Feb 3, 2025Expand into selling wholesale with Shopify Academy’s learning path, B2B on Shopify: Lau...
By Shopify Jan 28, 2025