VendureImage
A component for displaying an image from a Vendure asset.
Supports the following features:
- Presets
- Cropping
- Resizing
- Formatting
- Quality
- Focal point
- Fallback
Example
Parameters
props
VendureImagePropsThe props for the VendureImage component.
- Extends:
React.ImgHTMLAttributes<HTMLImageElement>
asset
AssetLike | null | undefinedThe asset to display.
preset
ImagePresetThe preset to use for the image.
mode
ImageModeThe crop/resize mode to use for the image.
width
numberThe width of the image.
height
numberThe height of the image.
format
ImageFormatThe format of the image.
quality
numberThe quality of the image.
useFocalPoint
booleanWhether to use the asset's focal point in crop mode.
fallback
React.ReactNodeThe fallback to show if no asset is provided. If no fallback is provided, a default placeholder will be shown.
ref
React.Ref<HTMLImageElement>The ref to the image element.
The type of object that can be used as an asset in the VendureImage component.
id
stringpreview
stringname
string | nullfocalPoint
{ x: number; y: number } | nullThe presets that can be used for the VendureImage component.
The formats that can be used for the VendureImage component.
The modes that can be used for the VendureImage component.