rsnext/examples/image-component
Luc Leray f52955ec94
Clean up examples package.json (#27121)
Clean up package.json files in the `examples` directory:
- Add `private: true`
- Remove `version` (because they are irrelevant for packages that are not meant to be published)
- Remove `name` (because they are optional for packages that are not meant to be published, and when someone clones an example, they often rename it and the property becomes stale)
- Remove `author`
- Remove `description`
- Remove `license`

Also remove `with-dynamic-app-layout` example completely, since it does the same as `layout-component` (https://github.com/vercel/next.js/pull/27121#discussion_r668178408).

## Documentation / Examples

- [x] Make sure the linting passes
2021-07-12 19:58:03 +00: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 Clean up examples package.json (#27121) 2021-07-12 19:58:03 +00: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).