Skip to main content

CaImage

Display an image in a specific size

SASS-path: ./styles/components/atoms/ca-image.scss

Props

NameDescriptionTypeRequiredDefault
sizeArrayThe Array of Objects with image sizes for the image. E.g [{folder: '100x100', descriptor: '100w'}}Arrayfalse[]
sizesThe sizes stringStringfalse-
filenameThe filename part of the image pathStringfalse-
typeType of image, also name of the folder in the image pathStringfalse-
altA human friendly description of the image, for screen readers and SEOStringtrue-
ratioThe ratio of the image, height / widthNumbertrue-
forceRatioForce the image to keep supplied ratioBooleanfalsefalse
srcDirect link to image if not from image serviceStringfalse-
loadingValue for the loading attributeStringfalselazy
bannerImageImage will displayd in backgroundBooleanfalsefalse
srcsetSet srcet for imageStringfalse-

Events

Event NameDescriptionParameters
loadedWhen image is loaded-

Methods

MethodDescriptionParameters
loadedActionAction for when image is loaded-