Card image, 400 x 300
https://www.dummyimg.in/placeholder?width=400&height=300
Framework examples
A DummyImg URL is a normal image URL, so it works in every framework. These examples show the idiomatic way to use one in each, plus the one config change Next.js needs.
auto_awesome Open the generator
https://www.dummyimg.in/placeholder?width=400&height=300
https://www.dummyimg.in/placeholder?width=1200&height=400&text=Hero
https://www.dummyimg.in/placeholder?width=96&height=96&text=JD&bg_color=%23245bd8&text_color=%23ffffff
https://www.dummyimg.in/placeholder?width=640&height=360&format=SVG
Always set width and height on the image element as well as in the URL. The browser then reserves the space before the image loads, so the layout doesn't jump (no cumulative layout shift).
For many small placeholders, format=SVG gives the smallest files. For screenshots and social previews, use PNG or WEBP.
function ProductCard({ name }) {
return (
<img
src="https://www.dummyimg.in/placeholder?width=400&height=300&text=Product"
width={400} height={300} alt={name}
/>
);
}
// next.config.js
module.exports = {
images: {
remotePatterns: [{ protocol: "https", hostname: "www.dummyimg.in" }],
},
};
// page.jsx
import Image from "next/image";
<Image src="https://www.dummyimg.in/placeholder?width=400&height=300" width={400} height={300} alt="" />
<template>
<img :src="url" :width="w" :height="h" alt="Placeholder" />
</template>
<script setup>
const w = 400, h = 300;
const url = `https://www.dummyimg.in/placeholder?width=${w}&height=${h}`;
</script>
<img
ngSrc="https://www.dummyimg.in/placeholder?width=400&height=300"
width="400" height="300" alt="Placeholder"
/>
<script>
export let w = 400, h = 300;
</script>
<img src={`https://www.dummyimg.in/placeholder?width=${w}&height=${h}`} width={w} height={h} alt="" />
<div class="h-64 bg-cover bg-center
bg-[url('https://www.dummyimg.in/placeholder?width=1200&height=400&text=Hero')]">
</div>
next/image only loads remote images from hosts you allow. Add www.dummyimg.in to images.remotePatterns in next.config.js, as in the example above, then restart the dev server.
next/image blocks remote SVG by default. Either use format=PNG or WEBP, or set images.dangerouslyAllowSVG in next.config.js if you understand the trade-off.
Yes. The URL is plain text, so it renders the same on the server and in the browser.
Yes. The /placeholder and /download endpoints send CORS headers, so fetch() works from any origin.