You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/api-reference/next/legacy/image.md
+11-11
Original file line number
Diff line number
Diff line change
@@ -89,18 +89,18 @@ The layout behavior of the image as the viewport changes size.
89
89
|`responsive`| Scale to fit width of container |`640w`, `750w`, ... `2048w`, `3840w` (based on [imageSizes](#image-sizes) and [deviceSizes](#device-sizes)) |`100vw`| yes |
90
90
|`fill`| Grow in both X and Y axes to fill container |`640w`, `750w`, ... `2048w`, `3840w` (based on [imageSizes](#image-sizes) and [deviceSizes](#device-sizes)) |`100vw`| yes |
91
91
92
-
-[Demo the `intrinsic` layout (default)](https://image-component.nextjs.gallery/layout-intrinsic)
92
+
-[Demo the `intrinsic` layout (default)](https://image-legacy-component.nextjs.gallery/layout-intrinsic)
93
93
- When `intrinsic`, the image will scale the dimensions down for smaller viewports, but maintain the original dimensions for larger viewports.
94
-
-[Demo the `fixed` layout](https://image-component.nextjs.gallery/layout-fixed)
94
+
-[Demo the `fixed` layout](https://image-legacy-component.nextjs.gallery/layout-fixed)
95
95
- When `fixed`, the image dimensions will not change as the viewport changes (no responsiveness) similar to the native `img` element.
96
-
-[Demo the `responsive` layout](https://image-component.nextjs.gallery/layout-responsive)
96
+
-[Demo the `responsive` layout](https://image-legacy-component.nextjs.gallery/layout-responsive)
97
97
- When `responsive`, the image will scale the dimensions down for smaller viewports and scale up for larger viewports.
98
98
- Ensure the parent element uses `display: block` in their stylesheet.
99
-
-[Demo the `fill` layout](https://image-component.nextjs.gallery/layout-fill)
99
+
-[Demo the `fill` layout](https://image-legacy-component.nextjs.gallery/layout-fill)
100
100
- When `fill`, the image will stretch both width and height to the dimensions of the parent element, provided the parent element is relative.
101
101
- This is usually paired with the [`objectFit`](#objectFit) property.
102
102
- Ensure the parent element has `position: relative` in their stylesheet.
This example shows how to use the [Image Component in Next.js](https://nextjs.org/docs/api-reference/next/image) serve optimized, responsive images.
3
+
This example shows how to use the [Legacy Image Component in Next.js](https://nextjs.org/docs/api-reference/next/legacy/image) serve optimized, responsive images.
4
4
5
5
The index page ([`pages/index.js`](pages/index.js)) has a couple images, one internal image and one external image. In [`next.config.js`](next.config.js), the `domains` property is used to enable external images. The other pages demonstrate the different layouts. Run or deploy the app to see how it works!
Deploy the example using [Vercel](https://vercel.com?utm_source=github&utm_medium=readme&utm_campaign=next-example) or preview live with [StackBlitz](https://stackblitz.com/github/vercel/next.js/tree/canary/examples/image-legacy-component)
14
14
15
-
[](https://vercel.com/new/git/external?repository-url=https://github.com/vercel/next.js/tree/canary/examples/image-component&project-name=image-component&repository-name=image-legacy-component)
15
+
[](https://vercel.com/new/git/external?repository-url=https://github.com/vercel/next.js/tree/canary/examples/image-legacy-component&project-name=image-legacy-component&repository-name=image-legacy-component)
16
16
17
17
## How to use
18
18
19
19
Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init), [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/), or [pnpm](https://pnpm.io) to bootstrap the example:
Deploy it to the cloud with [Vercel](https://vercel.com/new?utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)).
0 commit comments