rsnext/examples/image-component
2021-01-19 07:28:54 +00:00
..
components Fix ViewSource component in the docs (#19022) 2020-11-10 17:02:39 +00:00
pages Revise image example with layouts near the top (#19161) 2020-11-14 02:00:02 +00:00
public Update example for Image Component (#18762) 2020-11-03 15:40:53 -05:00
.gitignore Add docs for Image Optimization (#18107) 2020-10-24 14:53:28 +02:00
app.css Update Image docs with links to examples (#18770) 2020-11-04 17:24:14 +00:00
next.config.js Add docs for Image Optimization (#18107) 2020-10-24 14:53:28 +02:00
package.json Update image example with link back to source code (#18909) 2020-11-06 17:13:01 -05:00
README.md Include utm_source on example links to vercel.com (#21305) 2021-01-19 07:28:54 +00:00
styles.module.css Add props objectFit and objectPosition to Image component (#18849) 2020-11-05 19:42:55 +00:00

Image Component Example

This example shows how to use the Image Component in Next.js serve optimized, responsive images.

The index page (pages/index.js) has a couple images, one internal image and one external image. In 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 your own

Deploy the example using Vercel:

Deploy with Vercel

How to use

Execute create-next-app with npm or Yarn to bootstrap the example:

npx create-next-app --example image-component image-app
# or
yarn create next-app --example image-component image-app

Deploy it to the cloud with Vercel (Documentation).