Skip to content
AddHunt
Shopify apps

polaris-vue-elements

Vue 3 component wrappers with types for Shopify Polaris

Open source

  • Open source
  • Licence: MIT

In short

polaris-vue-elements is an open-source library of typed Vue 3 components that wrap Shopify's Polaris web components, with props, events and v-model support. It is meant for developers building Shopify apps in Vue who want autocomplete and type checking for Polaris.

What you get

  • 62 typed Vue 3 wrappers for Polaris web components
  • v-model on 17 form components
  • Generated from Shopify's Custom Elements Manifest
  • Unknown props pass through via $attrs
  • App Bridge components for Vue (beta)

The details

Shopify's Polaris web components, such as s-button, s-text-field and s-modal, run in any framework, but inside Vue templates they act as untyped custom elements with no autocomplete, prop checks or v-model. polaris-vue-elements, an independent open-source project, closes that gap by wrapping each element in a thin Vue 3 component, while the Polaris runtime itself still loads from Shopify's CDN.

Generated, not hand-written

All 62 wrappers and their types are generated from Shopify's Custom Elements Manifest by a single npm script, so the wrapper API follows the real component API. Seventeen form components support v-model, each mapped to the right prop and event pair. Unknown props pass through via $attrs and slot content is forwarded unchanged, so an older wrapper version keeps working and simply lacks types for newer features.

Components

Everything is imported from one package. Components are grouped into actions, feedback and status, forms, and layout and structure, and include buttons, menus, banners, spinners, text, date and money fields, color pickers, drop zones, grids and pages.

App Bridge

A separate entry point, polaris-vue-elements/app-bridge, is in beta and offers Vue versions of Modal, SaveBar, AppWindow, TitleBar and NavMenu plus a useAppBridge() function. It is only loaded when imported. The documentation is translated into several languages, including German, Spanish, French and Japanese.

Alternatives to polaris-vue-elements

Questions

Does polaris-vue-elements replace the Polaris runtime?

No. The Polaris runtime still loads from Shopify's CDN; the library adds typed Vue components with props, events and v-model on top of it.

What happens when Shopify adds new component features?

Unknown props pass through to the element, so existing code keeps working. The wrappers are regenerated from Shopify's manifest to add types for new features.

Is Shopify App Bridge supported?

Yes, in beta. A separate entry point provides Vue versions of App Bridge components such as Modal, SaveBar and TitleBar, plus useAppBridge().

More like this