https://github.com/jorisre/nextjs
https://github.com/jorisre/nextjs
Last synced: 9 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/jorisre/nextjs
- Owner: jorisre
- Created: 2020-11-08T17:11:01.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-11-08T17:11:10.000Z (about 5 years ago)
- Last Synced: 2024-10-30T06:01:44.487Z (about 1 year ago)
- Language: JavaScript
- Homepage: next-image-component-example.vercel.app
- Size: 285 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Image Component Example
This example shows how to use the [Image Component in Next.js](https://nextjs.org/docs/api-reference/next/image) serve optimized, responsive images.
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. Run or deploy the app to see how it works!
## Deploy your own
Deploy the example using [Vercel](https://vercel.com):
[](https://vercel.com/import/project?template=https://github.com/vercel/next.js/tree/canary/examples/image-component)
## How to use
Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example:
```bash
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](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)).