Simple BackgroundImage component for astro
npm install @mgcrea/astro-background-imageBasic component to render a background image with Astro.
- Leverages the getImage() helper from astro:assets to generate responsive image URLs.
- Supports srcset and widths attributes.
``sh`
npm install --dev @mgcrea/astro-background-imageor
pnpm add --save-dev @mgcrea/astro-background-image
`astro
---
import BackgroundImage from '@mgcrea/astro-background-image';
import heroSrc from "src/assets/hero.jpg";
---
Hero
``