Skip to content

Commit

Permalink
Update next/image docs for width & height
Browse files Browse the repository at this point in the history
  • Loading branch information
styfle committed Mar 16, 2022
1 parent 98d7ee3 commit c00a86c
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions docs/api-reference/next/image.md
Expand Up @@ -48,15 +48,27 @@ When using an external URL, you must add it to

### width

The width of the image, in pixels. Must be an integer without a unit.
The width of the image. Must be an integer without a unit.

Required, except for statically imported images, or those with [`layout="fill"`](#layout).
The meaning of the `width` property can change depending on the [`layout`](#layout) and [`sizes`](#sizes) properties since some layouts will stretch to fill the parent container and others will not.

The `width` property represents the _rendered_ width in pixels when `layout="intrinsic"`, `layout="fixed"`, or `layout="raw"` without `sizes` so it will affect how large the image appears.

The `width` property represents the _original_ width in pixels when `layout="responsive"`, `layout="fill"`, or `layout="raw"` with `sizes` so it will only affect the aspect ratio.

Required, except for [statically imported images](#local-images), or those with `layout="fill"`.

### height

The height of the image, in pixels. Must be an integer without a unit.
The height of the image. Must be an integer without a unit.

The meaning of the `height` property can change depending on the [`layout`](#layout) and [`sizes`](#sizes) properties since some layouts will stretch to fill the parent container and others will not.

The `height` property represents the _rendered_ height in pixels when `layout="intrinsic"`, `layout="fixed"`, or `layout="raw"` without `sizes` so it will affect how large the image appears.

The `height` property represents the _original_ height in pixels when `layout="responsive"`, `layout="fill"`, or `layout="raw"` with `sizes` so it will only affect the aspect ratio.

Required, except for statically imported images, or those with [`layout="fill"`](#layout).
Required, except for [statically imported images](#local-images), or those with `layout="fill"`.

## Optional Props

Expand Down

0 comments on commit c00a86c

Please sign in to comment.