---
title: "UiModal"
description: "Full-screen modal outside the iframe. Wraps the App Bridge <ui-modal> web component."
canonical_url: "https://shopify.yan.ad/components/app-bridge-ui/ui-modal"
---
# UiModal

> Full-screen modal outside the iframe. Wraps the App Bridge <ui-modal> web component.

## Live preview

This component integrates with Shopify App Bridge and requires an authenticated Shopify admin host. It cannot run faithfully in a standalone documentation iframe. Use the [authenticated playground](https://github.com/yan-ad/nuxt-shopify/tree/main/playground) to try it with your development store.

## Shopify admin example

```vue
<script setup>
const shopify = useAppBridge()

function openModal() {
  shopify.modal.show('my-modal')
}

function closeModal() {
  shopify.modal.hide('my-modal')
}

function handleSave() {
  // ...save logic
  closeModal()
}
</script>

<template>
  <ShButton @click="openModal">Open Modal</ShButton>

  <ShUiModal id="my-modal" variant="large" @hide="closeModal">
    <p>This content renders outside the iframe.</p>

    <template #title-bar>
      <ShUiTitleBar
        title="Edit Product"
        :primary-action="{ label: 'Save', onClick: handleSave }"
      />
    </template>
  </ShUiModal>
</template>
```

<warning>

`ShUiModal` renders **outside** your app's iframe in the Shopify Admin shell. For an in-iframe modal, use [`ShModal`](https://shopify.yan.ad/components/overlays/modal).

</warning>

## Props

<table>
<thead>
  <tr>
    <th>
      Prop
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Required
    </th>
    
    <th>
      Default
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        id
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Yes
    </td>
    
    <td>
      —
    </td>
    
    <td>
      Unique identifier
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        variant
      </code>
    </td>
    
    <td>
      <code>
        'small' | 'base' | 'large' | 'max'
      </code>
    </td>
    
    <td>
      No
    </td>
    
    <td>
      <code>
        'base'
      </code>
    </td>
    
    <td>
      Modal size
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        src
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      No
    </td>
    
    <td>
      —
    </td>
    
    <td>
      URL to load in an iframe inside the modal
    </td>
  </tr>
</tbody>
</table>

## Events

<table>
<thead>
  <tr>
    <th>
      Event
    </th>
    
    <th>
      Payload
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        show
      </code>
    </td>
    
    <td>
      <code>
        Event
      </code>
    </td>
    
    <td>
      Emitted when the modal opens
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        hide
      </code>
    </td>
    
    <td>
      <code>
        Event
      </code>
    </td>
    
    <td>
      Emitted when the modal closes
    </td>
  </tr>
</tbody>
</table>

## Slots

<table>
<thead>
  <tr>
    <th>
      Slot
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        default
      </code>
    </td>
    
    <td>
      Modal body content
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        title-bar
      </code>
    </td>
    
    <td>
      <code>
        <ShUiTitleBar>
      </code>
      
       for modal header
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        save-bar
      </code>
    </td>
    
    <td>
      <code>
        <ShUiSaveBar>
      </code>
      
       for modal actions
    </td>
  </tr>
</tbody>
</table>

## App Bridge API

<table>
<thead>
  <tr>
    <th>
      Method
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        shopify.modal.show(id)
      </code>
    </td>
    
    <td>
      Shows the modal
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        shopify.modal.hide(id)
      </code>
    </td>
    
    <td>
      Hides the modal
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        shopify.modal.toggle(id)
      </code>
    </td>
    
    <td>
      Toggles modal visibility
    </td>
  </tr>
</tbody>
</table>

## App Bridge Element

Renders as `<ui-modal>`. See [App Bridge Modal docs](https://shopify.dev/docs/api/app-bridge-library/web-components/ui-modal).


## Sitemap

See the full [sitemap](https://shopify.yan.ad/sitemap.md) for all pages.
