rw.resizeResource
Syntax
const resizedPath = rw.resizeResource(resource, width);Parameters
Parameter
Type
Description
Returns
Basic Example
const transformHook = (rw) => {
const { image } = rw.props;
// Create a thumbnail at 400px wide
const thumbnail = rw.resizeResource(image, 400);
rw.setProps({
thumbnail
});
};
exports.transformHook = transformHook;Common Patterns
Multiple Sizes
Retina/HiDPI Support
Responsive Images with Breakpoints
Gallery Thumbnails
Responsive Image with Custom Sizes
Template Usage
Notes
Last updated
Was this helpful?

