Image Optimization in Astro with Astro ImageTools

This page demonstrates the usage of the astro-imagetools library with live examples.


Components

APIs

Layout

The layout property tells the image to respond differently depending on the device size or the container size.

Select a layout below and try resizing the window or rotating your device to see how the image reacts.


Placeholder

The placeholder property tells the image what to show while loading.


Internal Image

The following is an example of a reference to an internal image in the src directory (../images/elva-800w.jpg).

A father holding his beloved daughter in his arms


External Image

The following is an example of a reference to an external image (https://picsum.photos/1024/768).

A random image


Image in /public

This image is in the public directory (/images/public.jpeg).

A random image


Learn More

You can optionally configure many more things!

Checkout the Astro ImageTools documentation to learn more.