2018-08-31 20:13:20 +00:00
|
|
|
`ProductImage` (component)
|
|
|
|
==========================
|
|
|
|
|
2018-11-13 15:40:17 +00:00
|
|
|
Use `ProductImage` to display a product's or variation's featured image.
|
|
|
|
If no image can be found, a placeholder matching the front-end image
|
2018-08-31 20:13:20 +00:00
|
|
|
placeholder will be displayed.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Props
|
|
|
|
-----
|
|
|
|
|
|
|
|
### `width`
|
|
|
|
|
|
|
|
- Type: Number
|
|
|
|
- Default: `60`
|
|
|
|
|
|
|
|
The width of image to display.
|
|
|
|
|
|
|
|
### `height`
|
|
|
|
|
|
|
|
- Type: Number
|
|
|
|
- Default: `60`
|
|
|
|
|
|
|
|
The height of image to display.
|
|
|
|
|
|
|
|
### `className`
|
|
|
|
|
|
|
|
- Type: String
|
|
|
|
- Default: `''`
|
|
|
|
|
|
|
|
Additional CSS classes.
|
|
|
|
|
|
|
|
### `product`
|
|
|
|
|
|
|
|
- Type: Object
|
|
|
|
- Default: null
|
|
|
|
|
2018-11-13 15:40:17 +00:00
|
|
|
Product or variation object. The image to display will be pulled from
|
|
|
|
`product.images` or `variation.image`.
|
2018-08-31 20:13:20 +00:00
|
|
|
See https://woocommerce.github.io/woocommerce-rest-api-docs/#product-properties
|
2018-11-13 15:40:17 +00:00
|
|
|
and https://woocommerce.github.io/woocommerce-rest-api-docs/#product-variation-properties
|
2018-08-31 20:13:20 +00:00
|
|
|
|
|
|
|
### `alt`
|
|
|
|
|
|
|
|
- Type: String
|
|
|
|
- Default: null
|
|
|
|
|
|
|
|
Text to use as the image alt attribute.
|
|
|
|
|