Polaris Components
Overview
This module provides Vue wrapper components for Shopify Polaris web components. Use the Sh-prefixed wrappers instead of raw s-* web components — they provide typed props with autocomplete, v-model support for form components, and work seamlessly with Vue's reactivity system.
All Sh* components are auto-imported — no manual imports needed.
Component Prefix
All components use a configurable prefix (default: Sh). You can change it via the componentPrefix module option:
// nuxt.config.ts
export default defineNuxtConfig({
shopify: {
componentPrefix: 'Shopify' // <ShopifyButton>, <ShopifyApp>, etc.
}
})
The examples below use the default Sh prefix.
Basic Example
<template>
<ShPage heading="Products">
<ShStack gap="base">
<ShButton variant="primary" @click="save">Save</ShButton>
<ShButton @click="cancel">Cancel</ShButton>
</ShStack>
<ShBanner heading="Welcome" tone="info" dismissible>
Start by adding your first product.
</ShBanner>
<ShTextField
v-model="title"
label="Product title"
placeholder="Enter product title"
/>
<ShSelect
v-model="status"
label="Status"
:options="[
{ label: 'Active', value: 'active' },
{ label: 'Draft', value: 'draft' }
]"
/>
</ShPage>
</template>
App Components
<ShApp>
Wrap your app pages with <ShApp> to automatically render the App Bridge navigation menu from your module config. See ShApp reference.
<template>
<ShApp>
<slot />
</ShApp>
</template>
<ShLoadingIndicator>
Bridges the Nuxt loading indicator with the Shopify Admin loading bar. See ShLoadingIndicator reference.
<template>
<ShLoadingIndicator>
<ShPage title="Products">
<!-- content -->
</ShPage>
</ShLoadingIndicator>
</template>
Available Components
Each Polaris component maps to its web component counterpart (e.g., <ShButton> → <s-button>). Browse the full reference with props, events, and slots:
| Category | Components | Reference |
|---|---|---|
| Layout | ShPage, ShBox, ShStack, ShGrid, ShGridItem, ShSection, ShDivider | Layout |
| Actions | ShButton, ShButtonGroup, ShClickable, ShLink | Actions |
| Forms | ShTextField, ShNumberField, ShEmailField, ShPasswordField, ShUrlField, ShMoneyField, ShColorField, ShDateField, ShTextArea, ShSelect, ShCheckbox, ShSwitch, ShChoiceList, ShChoice, ShSearchField, ShDropZone, ShColorPicker, ShDatePicker | Forms |
| Feedback | ShBanner, ShBadge, ShSpinner, ShTooltip | Feedback |
| Navigation | ShAppNav, ShMenu, ShOption, ShOptionGroup, ShPopover | Navigation |
| Data | ShTable, ShTableHeader, ShTableHeaderRow, ShTableBody, ShTableRow, ShTableCell | Data |
| Content | ShText, ShHeading, ShParagraph, ShIcon, ShImage, ShThumbnail, ShAvatar, ShChip, ShClickableChip, ShListItem, ShOrderedList, ShUnorderedList | Content |
| Overlays | ShModal, ShQueryContainer | Overlays |
| App Bridge UI | ShUiModal, ShUiTitleBar, ShUiSaveBar, ShUiNavMenu | App Bridge UI |
Polaris Modal (ShModal)
ShModal wraps the Polaris <s-modal> component — it renders inside your app's iframe. Open and close it using commandFor / command attributes:
<template>
<ShButton command-for="my-modal" command="--show">Open</ShButton>
<ShModal id="my-modal" heading="Confirm action">
<ShParagraph>Are you sure?</ShParagraph>
<ShButton slot="secondary-actions" command-for="my-modal" command="--hide">
Cancel
</ShButton>
<ShButton
slot="primary-action"
variant="primary"
command-for="my-modal"
command="--hide"
>
Confirm
</ShButton>
</ShModal>
</template>
<s-modal> programmatically: shopify.modal.show('my-modal'), shopify.modal.hide('my-modal'), shopify.modal.toggle('my-modal').ShModal is not the same as the App Bridge <ui-modal> which renders outside the iframe. If you need the App Bridge modal, use <ShUiModal>.App Bridge UI Components (ShUi*)
In addition to the Polaris Sh* components (rendered inside your iframe), the module provides ShUi* wrappers for App Bridge UI web components (ui-*). These render outside the app iframe in the Shopify Admin shell.
These are the Vue replacements for @shopify/app-bridge-react components (Modal, TitleBar, SaveBar, NavMenu).
Polaris (Sh*) vs App Bridge (ShUi*)
Polaris (Sh*) | App Bridge (ShUi*) | |
|---|---|---|
| HTML elements | <s-button>, <s-modal>, etc. | <ui-modal>, <ui-title-bar>, etc. |
| Renders in | Your app's iframe | Shopify Admin (outside the iframe) |
| Use for | In-app UI: forms, tables, buttons, layout | Admin-level chrome: page title, modals overlaying the admin, save bar, navigation |
| Controlled via | Props, slots, command/commandFor | useAppBridge() API (shopify.modal.show(id), etc.) |
For detailed props, events, and usage examples, see the individual component pages:
<ShUiModal>— Full-screen modal outside the iframe<ShUiTitleBar>— Admin page title bar with action buttons<ShUiSaveBar>— Contextual save/discard bar<ShUiNavMenu>— Admin sidebar navigation menu
Related App Bridge APIs
All ShUi* components can be controlled programmatically via the shopify global (accessed with useAppBridge()):
| API | Description | Docs |
|---|---|---|
shopify.modal | Show, hide, and toggle modals by ID | Modal API |
shopify.saveBar | Show, hide, toggle save bars and prompt leave confirmation | Save Bar API |
shopify.toast.show(message) | Show toast notifications | Toast API |
shopify.loading.show() / .hide() | Control the admin loading bar | Loading API |
shopify.resourcePicker() | Open product/collection/variant pickers | Resource Picker API |
shopify.intents.navigate() | Launch native Shopify admin workflows | Intents API |
See the full list at App Bridge APIs and web methods.