--- url: /reference/items/FigureShopify/examples.md --- # Examples ## Simple This is a simple example using a 1 × 1 pixels transparent PNG as a placeholder. :::code-group ```js import { registerComponent } from '@studiometa/js-toolkit'; import { FigureShopify } from '@studiometa/ui'; // The Twig and Liquid templates write `data-component="Figure"`. A component mounts on its // configured name only, so the storefront variant is registered under that name by a subclass // which declares it. class Figure extends FigureShopify { static config = { name: 'Figure', }; } registerComponent(Figure); ``` ::: ## Blurred placeholder This example uses a small sized image with a maximum width of 10 pixels with a blur backdrop-filter as a placeholder. :::code-group ```js import { registerComponent } from '@studiometa/js-toolkit'; import { FigureShopify } from '@studiometa/ui'; // The Twig and Liquid templates write `data-component="Figure"`. A component mounts on its // configured name only, so the storefront variant is registered under that name by a subclass // which declares it. class Figure extends FigureShopify { static config = { name: 'Figure', }; } registerComponent(Figure); ``` ::: ## Advanced reveal :::code-group ```css html { background-color: #f1c092; } html.dark { background-color: #a76844; color: #eee; } body { padding: 1rem; } ``` :::