--- url: /reference/items/FigureGlide.md --- # FigureGlide Use the `FigureGlide` component to display responsive images with a [League Glide](https://glide.thephpleague.com/) server. ## Usage Register the component in your JavaScript app and use it in your templates. The component sets the `w` and `h` parameters of the `data-src` URL to the size of the `` DOM element, multiplied by the device pixel ratio. It keeps the other parameters of the URL. A component mounts on its configured name, and the markup below writes `data-component="Figure"`, so declare that name on a subclass: ```js import { registerComponent } from '@studiometa/js-toolkit'; import { FigureGlide } from '@studiometa/ui'; class Figure extends FigureGlide { static config = { name: 'Figure', }; } registerComponent(Figure); ``` ```html
``` ### Size grid Each dimension is rounded up to a multiple of the [`step` option](./js-api.md#step), after the multiplication by the device pixel ratio. A dimension larger than the [`maxSize` option](./js-api.md#maxsize) scales the two dimensions down with the ratio of the image, and the result is rounded to the grid again, but not above `maxSize`. Thus the component only requests a limited set of sizes, which the server can cache. With the default options, an image shown at `320×380` pixels on a screen with a device pixel ratio of `2` requests `w=700&h=800`. ::: warning Signed URLs A [signed URL](https://glide.thephpleague.com/3.0/config/security/) is not valid when its `w` and `h` parameters change. Configure the server to accept unsigned URLs for the sizes of the grid, or set the [`disable` option](./js-api.md#disable) to keep the URL of the template. :::