<NuxtPicture> is a drop-in replacement for the native <picture> tag.
Usage of <NuxtPicture> is almost identical to <NuxtImg> but it also allows serving modern formats like webp when possible.
Learn more about the <picture> tag on MDN.
Setup
In order to use<NuxtPicture> you should install and enable the Nuxt Image module:
Usage
<NuxtPicture> outputs a native <picture> tag with multiple <source> elements for different formats and a fallback <img> tag:
Props
<NuxtPicture> accepts all native <picture> and <img> attributes plus additional props for image optimization:
The source URL of the image.
The width of the image in pixels. Used for image optimization.
The height of the image in pixels. Used for image optimization.
Responsive sizes for different viewport widths. Example:
"sm:100vw md:50vw lg:400px"Alternative text for the image. Important for accessibility.
Comma-separated list of formats to generate (e.g.,
"webp,avif,png").The quality of the optimized image (0-100).
Native lazy loading attribute.
The image provider to use (e.g.,
"cloudinary", "imgix", "ipx").A predefined set of image modifiers.
Additional attributes to apply to the
<img> element.Learn More
NuxtPicture Documentation
Read the complete documentation for
<NuxtPicture> component in the Nuxt Image module docs.