# Animation [component-header:sl-animation] Animate elements declaratively with nearly 100 baked-in presets, or roll your own with custom keyframes. Powered by the [Web Animations API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Animations_API). To animate an element, wrap it in `` and set a `name` and `duration`. Refer to the [properties table](#properties) for additional options. ```html preview
``` ?> The animation will be applied only to the first child element found in ``. ## Examples ### Animations & Easings This example demonstrates all of the baked-in animations and easings. Animations are based on those found in the popular [Animate.css](https://animate.style/) library. ```html preview
``` ### Using Intersection Observer Use an [Intersection Observer](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API) to control the animation when an element enters or exits the viewport. For example, scroll the box below in and out of your screen. The animation stops when the box exits the viewport and restarts each time it enters the viewport. ```html preview
``` ### Custom Keyframe Formats Supply your own [keyframe formats](https://developer.mozilla.org/en-US/docs/Web/API/Web_Animations_API/Keyframe_Formats) to build custom animations. ```html preview
``` [component-metadata:sl-animation]