You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The framework-neutral renderer from the previous issue defines the HTML and SSR contract for Shopify's account widget. React and Vue users should receive idiomatic bindings that hide Shopify's element hierarchy, slot assignment, event wiring and CSP-safe layout styles.
The <shopify-account> Storefront Web Component renders a customer-account avatar. When selected, it opens Shopify's account sheet with sign-in options or signed-in customer links.
The signed-out avatar must be explicit and required. Broad React children and Vue default-slot APIs make its purpose unclear and allow an empty SSR fallback by accident.
Both bindings should render the supplied content inside one Hydrogen-owned wrapper with slot="signed-out-avatar". Consumers must not add the native slot attribute themselves.
Event behaviour
Shopify dispatches open and close as non-bubbling CustomEvents from <shopify-account>.
React must attach listeners directly with addEventListener() so the binding works with both React 18 and React 19.
Vue must listen on the underlying <shopify-account> and re-emit framework events from the wrapper component.
Listeners must be updated and removed when handlers or component lifecycles change.
Acceptance criteria
Export ShopifyAccountWidget and its prop types from @shopify/hydrogen/react.
Export the equivalent component and types from @shopify/hydrogen/vue.
React requires signedOutAvatar: ReactElement; it does not use children for the avatar.
Vue requires an explicit signed-out-avatar named slot; it does not use the default slot.
Both bindings add slot="signed-out-avatar" through a stable Hydrogen-owned wrapper.
The bindings render the shared core structure and nonce-bearing stylesheet without copying attribute, default or CSS knowledge.
The bindings do not require className, user CSS or inline style attributes for layout stability.
Documentation requires visual-only avatar content. It must not include links, buttons or other focusable elements because Shopify projects it inside its own button.
React exposes onOpen and onClose and listens directly on the custom element using native event listeners.
Vue exposes open and close events and listens directly on the custom element.
Event tests verify the documented event object, listener replacement and cleanup.
Changing, adding or removing customerAccessToken causes the widget to reflect the new signed-in state. If Shopify does not observe the store attribute, deliberately remount the custom element and test that behaviour.
SSR and hydration complete without mismatches, including when a CSP nonce is present.
Parent
Context
The framework-neutral renderer from the previous issue defines the HTML and SSR contract for Shopify's account widget. React and Vue users should receive idiomatic bindings that hide Shopify's element hierarchy, slot assignment, event wiring and CSP-safe layout styles.
The
<shopify-account>Storefront Web Component renders a customer-account avatar. When selected, it opens Shopify's account sheet with sign-in options or signed-in customer links.The signed-out avatar must be explicit and required. Broad React
childrenand Vue default-slot APIs make its purpose unclear and allow an empty SSR fallback by accident.Proposed APIs
React uses a required prop:
Vue uses an explicit required named slot rather than its broad default slot:
Both bindings should render the supplied content inside one Hydrogen-owned wrapper with
slot="signed-out-avatar". Consumers must not add the native slot attribute themselves.Event behaviour
Shopify dispatches
openandcloseas non-bubblingCustomEvents from<shopify-account>.addEventListener()so the binding works with both React 18 and React 19.<shopify-account>and re-emit framework events from the wrapper component.Acceptance criteria
ShopifyAccountWidgetand its prop types from@shopify/hydrogen/react.@shopify/hydrogen/vue.signedOutAvatar: ReactElement; it does not usechildrenfor the avatar.signed-out-avatarnamed slot; it does not use the default slot.slot="signed-out-avatar"through a stable Hydrogen-owned wrapper.className, user CSS or inlinestyleattributes for layout stability.onOpenandonCloseand listens directly on the custom element using native event listeners.openandcloseevents and listens directly on the custom element.customerAccessTokencauses the widget to reflect the new signed-in state. If Shopify does not observe the store attribute, deliberately remount the custom element and test that behaviour.renderShopifyAccountWidget()integration with the React binding without changing its rendered behaviour.ShopifyScripts accountWidgetis still required.Out of scope
childrenor Vue default-slot content.slot="signed-out-avatar".Blocked by
References
<shopify-account>events and slotspackages/hydrogen/src/react/shop-pay.tsxpackages/hydrogen/src/vue/shop-pay.tspackages/hydrogen/skills/hydrogen-customer-account/SKILL.md