Cldimage

Configuration

The CldImage component provides a wide range of options for being able to easily optimize and transform images.

Configuration for CldImage is the same as useCldImageUrl, which both use the same underlying API.

Required Props

The basic props required to use CldImage include:

PropTypeRequiredExample
altstringYesDog catching a frisbee
heightnumber/stringYes600
srcstringYesmy-public-id
widthnumber/stringYes600

Unpic props

CldImage extends the Upnic Image component using Cloudinary tech. This means all props available on the Upic component are available on CldImage. Learn more on the Unpic docs

Basic Transformations

The CldImage component exposes many of Cloudinary's transformations in an easy-to-use way right inside of Nuxt.

PropTypeDefaultExampleMore
cropstring"limit""thumb"Link
backgroundstring-"blue"Link
fillBackground (Beta)boolean/object-{{ gravity: 'east' }}Link
gravitystringauto"faces"Link
recolorarray/object-['duck', 'blue']Link
removestring/array/object-appleLink
removeBackgroundboolean/stringfalsetrueLink
replacearray/object-['apple', 'banana']Link
restoreboolean-trueLink
zoomstring-0.5Link
zoompanboolean/string/object-trueLink

General Props

Following props can be passed to the CldImage component to make it work in more advanced scenarios.

Prop NameTypeDefaultExample
cropstring"limit""thumb"
deliveryTypestring"upload""fetch"
effectsarray-[{ background: 'blue' }]
formatstring"auto""webp"
gravitystring"auto""faces"
heightnumber/string-600
overlaysarray-See Below
preserveTransformationsstringfalsetrue
qualitystring"auto""90"
rawTransformationsarray-['e_blur:2000']
removeBackgroundbool/stringfalsetrue
sanitizebooltrue if svgtrue (Applies only to SVG)
seoSuffixstring-my-image-content
srcstring-"my-public-id"
textstring-"Nuxt Cloudinary"
transformationsstring/array-['my-named-transformation']
underlaystring-"my-public-id"
underlaysarray-See Below
versionnumber-1234
widthnumber/string-600
zoomstring-0.5
zoompanbool/string/object-See Below
fillBackgroundbool/object-true

Filters & Effects

All effect props are disabled by default.

Prop NameTypeExampleMore
artstring"al_dente"Link
autoBrightnessbool/stringtrue, "80"Link
autoColorbool/stringtrue, "80"Link
autoContrastbool/stringtrue, "80"Link
assistColorblindbool/stringtrue, "20", "xray"Link
blackwhitebool/stringtrue, "40"Link
blurbool/stringtrue, "800"Link
blurFacesbool/stringtrue, "800"Link
blurRegionbool/stringtrue, "1000,h_425,w_550,x_600,y_400"Link
borderstring"5px_solid_purple"-
brightnessbool/stringtrue, "100"Link
brightnessHSBbool/stringtrue, "100"Link
cartoonifybool/stringtrue, "70:80"Link
colorstring"blue"-
colorizestring"35,co_darkviolet"Link
contrastbool/stringtrue, "100", "level_-70"Link
distortstring"150:340:1500:10:1500:1550:50:1000", "arc:180.0"Link
fillLightbool/stringtrue, "70:20"Link
gammabool/stringtrue, "100"Link
gradientFadebool/stringtrue, "symmetric:10,x_0.2,y_0.4"Link
grayscalebooltrueLink
improvebool/stringtrue, "50", "indoor"Link
multiplybooltrueLink
negatebooltrueLink
oilPaintbool/stringtrue, "40"Link
opacitynumber/string40, "40"Link
outlinebool/stringtrue, "40", "outer:15:200"Link
overlaybooltrueLink
pixelatebool/stringtrue, "20"Link
pixelateFacesbool/stringtrue, "20"Link
pixelateRegionbool/stringtrue, "35,h_425,w_550,x_600,y_400"Link
redeyebool/stringtrueLink
replaceColorstring"saddlebrown", "2F4F4F:20", "silver:55:89b8ed"Link
sanitizebool/true, "70"Link
saturationbool/stringtrue, "70"Link
screenbooltrueLink
sepiabool/stringtrue, "50"Link
shadowbool/stringtrue, "50,x_-15,y_15"Link
sharpenbool/stringtrue, "100"Link
shearstring"20.0:0.0"Link
simulateColorblindbool/string"deuteranopia"Link
tintbool/stringtrue, "100:red:blue:yellow"Link
trimbool/stringtrue, "50:yellow"Link
unsharpMaskbool/stringtrue, "500"Link
vectorizebool/stringtrue, "3:0.5"Link
vibrancebool/stringtrue, "70"Link
vignettebool/stringtrue, "30"Link

View the Cloudinary docs to see learn more about using effects.

Overlays & Underlays

The overlays prop is an array of objects with the following configuration options:

Property NameTypeExample
appliedEffectsarraySame as effects, added as applied transformation
effectsarraySee Below
positionobjectSee Below
publicIdstring"thumb"
textobject/string"Nuxt Cloudinary" or See Below
urlstring"https://.../image.jpg"

The position property can include:

Property NameTypeExample
anglenumber45
gravitystring'"north_west"'
xnumber10
ynumber10

Objects in the effects array can include everything in the effects options above as well as:

Property NameTypeExample
aspectRatiostring"3.0"
cropstring10
gravitystring'"north_west"'
heightnumber'600'
widthnumber'600'

The text property can include:

Property NameTypeExample
borderstring"20px_solid_blue"
colorstring"blueviolet"
fontFamilystring"Open Sans"
fontSizenumber48
fontWeightstring"bold"
letterSpacingnumber"14"
lineSpacingnumber"14"
strokebooltrue in coordination with Border
textDecorationstring"underline"