Usage
In your current Astro project, just replace the import of the native Astro
<Image>
or
<Picture>
component with the one provided by
astro-lqip
.
Image
- import { Image } from 'astro:components';
+ import { Image } from 'astro-lqip/components';
Picture
- import { Picture } from 'astro:components';
+ import { Picture } from 'astro-lqip/components';
Example:
---
import { Image, Picture } from 'astro-lqip/components';
import image from './path/to/image.png';
import otherImage from './path/to/other-image.png';
---
<Image src={image} alt="Cover Image" width={220} height={220} />
<Picture src={otherImage} alt="Other cover Image" width={220} height={220} />