ShopifyStorefront blocks

The avatar block

A customer's avatar on a store page, in 2D or 3D, and what the 3D view needs from your store.

In build

Shows a logged-in customer their own avatar: the full-body character they dress from the wearables they have earned.

The same avatar appears beside the profile card. Use this block when you want the avatar on its own, larger, with a download button.

What customers see

ViewWhat it is
3DThe avatar standing in a lit scene. The customer can turn it by dragging and zoom with the wheel or a pinch.
2DThe same avatar as a flat picture

In the 3D view, a Reset camera button appears once they have moved it, and a Download button saves a picture of the avatar's upper body.

Visitors who are not logged in see a prompt to sign in. Nothing about any avatar is read for a visitor.

Customers do not dress their avatar in the store yet. They change it on your community's site, and the store shows the saved result. An editor block follows in a later release.

Settings

SettingDefaultWhat it does
HeadingMy avatarThe title above the avatar. Leave it empty for none.
View2D2D or 3D
Show DownloadOnThe download button under the 3D avatar
Accent colorEmptyFor this block only
Corner radius8 pxFor this block only

What the 3D view costs

The 3D view is a real 3D engine, and it is the one heavy thing in the whole set of blocks: about half a megabyte to download, against a few kilobytes for everything else.

It is loaded with care:

  • Only for a logged-in customer
  • Only when the view is set to 3D
  • Only when the avatar is about to scroll into view
  • Once per page, however many avatars are on it

A page with the view on 2D never downloads it. If a page feels heavy, that is the setting to change.

When 3D does not show

The block never shows a broken scene. Whenever 3D cannot work, the customer sees the 2D avatar and the theme editor shows a note saying why.

ReasonWhat to do
The customer's browser has no 3D graphics supportNothing. 2D is the right result.
One of their items has no 3D model yetNothing. It resolves when the model is published.
Your store blocks a file the scene needsAllow the hosts below

Files from outside your store

The 3D scene loads three kinds of file from other hosts.

FileHost
The lighting for the scenecdn.jsdelivr.net
The decoder for compressed modelswww.gstatic.com
The avatar's modelsYour community's media host

A store with no Content Security Policy needs to do nothing. If your theme or another app sets one, those hosts have to be allowed, or the scene falls back to 2D on every page.

To check, set the view to 3D on a development store, open the page logged in as a customer with an avatar, and look at the browser's console. A blocked host shows there as an error naming it.

For customers who prefer less motion

A customer whose device asks for reduced motion gets no floating particles and no fade between the 2D picture and the 3D scene. The avatar still stands in its idle pose.

Troubleshooting

What you seeCause
The block shows nothingSign-in is off, your community has avatars off, or the avatar could not be read. The theme editor says which.
"Sign in to see your avatar" after logging inCustomer accounts are off, or the store is not connected to your community
A flat avatar with the view on 3DSee the table above
No Download buttonShow Download is off, or the block is in 2D

On this page