Nuxt 2 is reaching End-of-Life on June 30th, 2024.

<NuxtPicture>

Nuxt provides a <NuxtPicture> component to handle automatic image optimization.

<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:

Terminal
npx nuxi@latest module add image
Read more about the <NuxtPicture> component.