import Head from 'next/head'; import { Callout } from 'nextra-theme-docs';
import { CldImage } from '../../../next-cloudinary';
import ImageGrid from '../../components/ImageGrid'; import OgImage from '../../components/OgImage'; import Video from '../../components/Video'; import VisualEditor from '../../components/VisualEditor';
<title>CldImage - Next Cloudinary</title>The CldImage component provides an easy way to deliver images from Cloudinary with the same experience you'd expect inside of a Next.js app.
With it comes access to more advanced features like dynamic cropping, background removal, overlays, and other Cloudinary transformations.
As CldImage is a wrapper around the Next.js Image component, you also gain access to all built-in Image component features will work out-of-the-box like Responsive Sizing.
The basic required props include width, height, src, and alt:
<VisualEditor
defaultCode={<CldImage width="960" height="600" src="images/galaxy" sizes="(max-width: 480px) 100vw, 50vw" removeBackground alt="" />}
/>
import { CldImage } from 'next-cloudinary';
<CldImage
width="960"
height="600"
src="<Public ID>"
sizes="100vw"
alt="Description of my image"
/>The sizes prop is optional, but recommended for Responsive Sizing.
The src property takes in a Cloudinary Public ID which includes the folder path along with the ID of the image itself.
You can further take advantage of Cloudinary features like background removal and overlays by adding additional props:
<CldImage
width="1200"
height="1200"
src="<Public ID>"
crop="thumb"
removeBackground
tint="70:blue:green:purple"
underlay="<Public ID>"
sizes="100vw"
alt="Description of my image"
/>If using a full Cloudinary URL, you might already have transformations applied to your image.
To preserve those transformations, you can apply the preserveTransformations property:
<CldImage
width="600"
height="600"
src="<Cloudinary URL>"
preserveTransformations
alt="Description of my image"
/>Note: Cloudinary URLs must include a version number (/v1234) in order to be correctly parsed.