---
title: "Using a fallback image with next/image"
description: "Learn how to use a fallback image while using the next/image component."
url: "https://vercel.com/templates/next.js/image-fallback"
links:
  repository: "https://github.com/vercel/examples/tree/main/solutions/image-fallback"
  demo: "https://solutions-image-fallback.vercel.app"
  deploy: "https://vercel.com/new/clone?demo-title=Using+a+fallback+image+with+next%2Fimage&demo-description=Learn+how+to+use+a+fallback+image+while+using+the+next%2Fimage+component.&demo-url=https%3A%2F%2Fsolutions-image-fallback.vercel.app&project-name=image-fallback&repository-name=image-fallback&repository-url=https%3A%2F%2Fgithub.com%2Fvercel%2Fexamples%2Ftree%2Fmain%2Fsolutions%2Fimage-fallback&demo-image=%2F%2Fimages.ctfassets.net%2Fe5382hct74si%2F2XKdBW2kOI5HJXVASrH8Bz%2F27b37f1cb65746135ba4620e6b67adcb%2Fsolutions-image-fallback.vercel.app_.png"
---

# Using a fallback image with next/image

Learn how to use a fallback image while using the next/image component.

This example shows how to use a fallback image while using the next/image component

## Demo

https://solutions-image-fallback.vercel.app

## How to Use

You can choose from one of the following two methods to use this repository:

### One-Click Deploy

Deploy the example using [Vercel](https://vercel.com?utm_source=github&utm_medium=readme&utm_campaign=next-example):

[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https://github.com/vercel/examples/tree/main/solutions/image-fallback&project-name=image-fallback&repository-name=image-fallback)

### Clone and Deploy

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 https://github.com/vercel/examples/tree/main/solutions/image-fallback
# or
yarn create next-app --example https://github.com/vercel/examples/tree/main/solutions/image-fallback
```

Next, run Next.js in development mode:

```bash
npm install
npm run dev

# or

yarn
yarn dev
```

Deploy it to the cloud with [Vercel](https://vercel.com/new?utm_source=github&utm_medium=readme&utm_campaign=edge-middleware-eap) ([Documentation](https://nextjs.org/docs/deployment)).

## Related Templates

### [Reducing bandwidth usage with next/image](https://vercel.com/templates/next.js/reduce-image-bandwidth-usage)

Learn how to reduce bandwidth and processing costs when using different layouts.

---

## Additional documentation

The [Vercel Knowledge Base](https://vercel.com/kb) contains guides and answers to common questions about Vercel, including deployment, framework configuration, domains, caching, and troubleshooting.
