<Image />
can be used to display images from different sources.
External images:
// Width and height are recommended for reservation of space
<Image src="https://source.unsplash.com/random/400x400" width={400} height={400} />
Static images:
// Width and height need to be provided manually, webp support is automatic
// Output with webp support: <img src="/images/dist/ipad.webp".../>
<Image src="ipad.png" width={2732} height={2048} />
Optimize images with:
node app/server.js imageOptimize
CMS images:
// Width, height and webp support are handled automatically
<Image src={props.data.image} />
// Optionally provide a size (default m) for the width (height will be automatic)
// xs => 100
// s => 480
// m => 720
// l => 1280
// xl => 1920
<Image src={props.data.image} size="xl" />
SVG images:
//
<Image src="/images/example.svg" />
Last modified | Wednesday, April 14, 2021, 12:36:29 PM UTC |
Last author | Colin van Eenige |
Commit ID | 990f719 |