Visitor sites
Image
An image whose box is reserved before its bytes arrive, so the text under it never moves. It is
part of site.css.
With its own size
Give both width and height and the image keeps its own shape:
Cropped to a ratio
Without a size the image is cropped to ratio, 16:9 unless you name another. A caption puts it in a figure:
API
| Prop | Type | Default | Description |
|---|---|---|---|
src required | string | no default | The image URL. |
alt required | string | no default | What the image shows. An empty string marks it decorative. |
width | number | no default | The image's own width in pixels. |
height | number | no default | The image's own height in pixels. |
ratio | '1/1' | '4/3' | '3/2' | '16/9' | '16/9' | The box an image without both width and height is cropped to. |
caption | string | no default | Drawn under the image, in a figure. |
loading | 'lazy' | 'eager' | 'lazy' | eager for an image a reader sees before scrolling. |
class | string | no default | Extra classes on the image or figure. |