rsnext/examples/image-component
Oscar Busk 077097b7f8
Remove licence from all example/package.json that has them (#28007)
* Add licences to all example/package.json that lack them

* Revert "Add licences to all example/package.json that lack them"

This reverts commit 5d4e25012f7334772b8ef5924bc355277e827cba.

* Update check-examples to remove `license` field from examples

* Remove `license` from all examples.

This was mentioned in vercel/next.js#27121 but it looks like it didn't end up being in the merge?

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2021-08-14 10:48:39 -05:00
..
components Fix ViewSource component in the docs (#19022) 2020-11-10 17:02:39 +00:00
pages Update next/image docs and example with shimmer animation (#26183) 2021-06-16 14:54:25 +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 Remove licence from all example/package.json that has them (#28007) 2021-08-14 10:48:39 -05:00
README.md Add link to live demo already hosted (#25718) 2021-06-25 11:52:54 -05: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!

Live demo

https://image-component.nextjs.gallery/

Preview

Preview the example live on StackBlitz:

Open in StackBlitz

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).