diff --git a/docs/3.api/2.components/10.nuxt-picture.md b/docs/3.api/2.components/10.nuxt-picture.md new file mode 100644 index 0000000000..964519d101 --- /dev/null +++ b/docs/3.api/2.components/10.nuxt-picture.md @@ -0,0 +1,22 @@ +--- +title: "" +description: "Nuxt provides a component to handle automatic image optimization." +--- + +`` is a drop-in replacement for the native `` tag. + +Usage of `` is almost identical to [``](./nuxt-img) but it also allows serving modern formats like `webp` when possible. + +Learn more about the [`` tag on MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/picture). + +## Setup + +In order to use `` you should install and enable the Nuxt Image module: + +```bash [Terminal] +npx nuxi@latest module add image +``` + +::read-more{to="https://image.nuxt.com/usage/nuxt-picture"} +Read more about the `` component. +:: diff --git a/docs/3.api/2.components/9.teleports.md b/docs/3.api/2.components/11.teleports.md similarity index 100% rename from docs/3.api/2.components/9.teleports.md rename to docs/3.api/2.components/11.teleports.md diff --git a/docs/3.api/2.components/9.nuxt-img.md b/docs/3.api/2.components/9.nuxt-img.md new file mode 100644 index 0000000000..a1789b9e61 --- /dev/null +++ b/docs/3.api/2.components/9.nuxt-img.md @@ -0,0 +1,38 @@ +--- +title: "" +description: "Nuxt provides a component to handle automatic image optimization." +--- + +`` is a drop-in replacement for the native `` tag. + +- Uses built-in provider to optimize local and remote images +- Converts `src` to provider-optimized URLs +- Automatically resizes images based on `width` and `height` +- Generates responsive sizes when providing `sizes` option +- Supports native lazy loading as well as other `` attributes + +## Setup + +In order to use `` you should install and enable the Nuxt Image module: + +```bash [Terminal] +npx nuxi@latest module add image +``` + +## Usage + +`` outputs a native `img` tag directly (without any wrapper around it). Use it like you would use the `` tag: + +```html + +``` + +Will result in: + +```html + +``` + +::read-more{to="https://image.nuxt.com/usage/nuxt-img"} +Read more about the `` component. +::