---
title: DeprecateLazysizes
description: Discourages use of the lazysizes library for lazy loading images, iframes, and scripts.
source_url:
html: https://shopify.dev/docs/storefronts/themes/tools/theme-check/checks/deprecate-lazysizes
md: https://shopify.dev/docs/storefronts/themes/tools/theme-check/checks/deprecate-lazysizes.md
---
ExpandOn this page
* [Examples](https://shopify.dev/docs/storefronts/themes/tools/theme-check/checks/deprecate-lazysizes#examples)
* [Disabling this check](https://shopify.dev/docs/storefronts/themes/tools/theme-check/checks/deprecate-lazysizes#disabling-this-check)
# DeprecateLazysizes
Discourages use of the [lazysizes JavaScript library](https://github.com/aFarkas/lazysizes) for lazy loading images, iframes, and scripts.
You should avoid using third-party libraries over native browser features to avoid large JavaScript bundle sizes and slow load times. [Learn more about theme performance](https://shopify.dev/docs/storefronts/themes/best-practices/performance).
This check identifies uses of the `lazyload` class, `data-srcset` and `data-sizes` attributes, and `data-sizes="auto"`.
***
## Examples
The following examples contain code snippets that either fail or pass this check.
### ✗ Fail
The following example includes a `lazyload` class:
```html
```
The following example includes a `lazyload` class, a `data-srcset` attribute, a `data-sizes` attribute, and `data-sizes="auto"`:
```html
```
### ✓ Pass
The following example uses the native `loading` attribute instead of the lazysizes library:
```html
```
***
## Disabling this check
You should disable this check only if you want to support lazy loading of images in browsers that don't support the `loading="lazy"` attribute.
***
* [Examples](https://shopify.dev/docs/storefronts/themes/tools/theme-check/checks/deprecate-lazysizes#examples)
* [Disabling this check](https://shopify.dev/docs/storefronts/themes/tools/theme-check/checks/deprecate-lazysizes#disabling-this-check)