# Animated Image [component-header:sl-animated-image] A component for displaying animated GIFs and WEBPs that play and pause on interaction. ```html preview ``` ```jsx react import { SlAnimatedImage } from '@shoelace-style/shoelace/dist/react'; const App = () => ( ); ``` ?> This component uses `` to draw freeze frames, so images are subject to [cross-origin restrictions](https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image). ## Examples ### WEBP Images Both GIF and WEBP images are supported. ```html preview ``` ```jsx react import { SlAnimatedImage } from '@shoelace-style/shoelace/dist/react'; const App = () => ( ); ``` ### Setting a Width and Height To set a custom size, apply a width and/or height to the host element. ```html preview ``` ```jsx react import { SlAnimatedImage } from '@shoelace-style/shoelace/dist/react'; const App = () => ( ); ``` ### Customizing the Control Box You can change the appearance and location of the control box by targeting the `control-box` part in your styles. ```html preview ``` ```jsx react import { SlAnimatedImage } from '@shoelace-style/shoelace/dist/react'; const css = ` .animated-image-custom-control-box::part(control-box) { top: auto; right: auto; bottom: 1rem; left: 1rem; background-color: deeppink; border: none; color: pink; } `; const App = () => ( <> ); ``` [component-metadata:sl-animated-image]