-`loading` - The loading behavior. When `lazy`, defer loading the image until it reaches a calculated distance from the viewport. When `eager`, load the image immediately. Default `lazy`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#attr-loading)
-`loading` - The loading behavior. When `lazy`, defer loading the image until it reaches a calculated distance from the viewport. When `eager`, load the image immediately. Default `lazy`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#attr-loading)
-`priority` - When true, the image will be considered high priority and [preload](https://web.dev/preload-responsive-images/).
-`priority` - When true, the image will be considered high priority and [preload](https://web.dev/preload-responsive-images/).
-`unoptimized` - When true, the source image will be served as-is instead of resizing and changing quality.
-`unoptimized` - When true, the source image will be served as-is instead of resizing and changing quality.
-`unsized` - When true, the `width` and `height` requirement can by bypassed. Should _not_ be used with `priority` or above-the-fold images.
-`unsized` - When true, the `width` and `height` requirement can by bypassed. Should _not_ be used with above-the-fold images. Should _not_ be used with `priority`.
Another other properties on the `<Image>` component be passed to the underlying `<img>` element.
All other properties on the `<Image>` component will be passed to the underlying `<img>` element.
@@ -19,7 +19,7 @@ The Automatic Image Optimization allows for resizing, optimizing, and serving im
...
@@ -19,7 +19,7 @@ The Automatic Image Optimization allows for resizing, optimizing, and serving im
## Image Component
## Image Component
To add an image to your application, import the `next/image` component:
To add an image to your application, import the [`next/image`](/docs/api-reference/next/image.md) component:
```jsx
```jsx
importImagefrom'next/image'
importImagefrom'next/image'
...
@@ -31,8 +31,8 @@ function Home() {
...
@@ -31,8 +31,8 @@ function Home() {
<Image
<Image
src="/me.png"
src="/me.png"
alt="Picture of the author"
alt="Picture of the author"
width={200}
width={500}
height={200}
height={500}
/>
/>
<p>Welcome to my homepage!</p>
<p>Welcome to my homepage!</p>
</>
</>
...
@@ -44,6 +44,7 @@ export default Home
...
@@ -44,6 +44,7 @@ export default Home
-`width` and `height` are required to prevent [Cumulative Layout Shift](https://web.dev/cls/), a [Core Web Vital](https://web.dev/vitals/) that Google is going to [use in their search ranking](https://webmasters.googleblog.com/2020/05/evaluating-page-experience.html)
-`width` and `height` are required to prevent [Cumulative Layout Shift](https://web.dev/cls/), a [Core Web Vital](https://web.dev/vitals/) that Google is going to [use in their search ranking](https://webmasters.googleblog.com/2020/05/evaluating-page-experience.html)
-`width` and `height` are automatically responsive, unlike the HTML `<img>` element
-`width` and `height` are automatically responsive, unlike the HTML `<img>` element
- See [`next/image`](/docs/api-reference/next/image.md) for list of available props.
## Configuration
## Configuration
...
@@ -89,19 +90,19 @@ module.exports = {
...
@@ -89,19 +90,19 @@ module.exports = {
The following Image Optimization cloud providers are supported:
The following Image Optimization cloud providers are supported:
- Imgix:`loader: 'imgix'`
- Imgix -`loader: 'imgix'`
- Cloudinary:`loader: 'cloudinary'`
- Cloudinary -`loader: 'cloudinary'`
- Akamai:`loader: 'akamai'`
- Akamai -`loader: 'akamai'`
- Vercel: No configuration necessary
- Vercel - No configuration necessary
## Related
## Related
For more information on what to do next, we recommend the following sections:
For more information on what to do next, we recommend the following sections: