You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Change alt to required in next/future/image (vercel#40136)
This `alt` attribute is required by `<img>` according to the HTML spec, so we should also make it required for `next/future/image`. In the cases where it is not needed, it can be set to the empty string.
https://html.spec.whatwg.org/multipage/images.html#alt
@@ -43,6 +44,7 @@ Compared to `next/image`, the new `next/future/image` component has the followin
43
44
- Removes `lazyBoundary` prop since there is no native equivalent
44
45
- Removes `lazyRoot` prop since there is no native equivalent
45
46
- Removes `loader` config in favor of [`loader`](#loader) prop
47
+
- Changed `alt` prop from optional to required
46
48
47
49
## Known Browser Bugs
48
50
@@ -175,6 +177,16 @@ The `height` property represents the _rendered_ height in pixels, so it will aff
175
177
176
178
Required, except for [statically imported images](/docs/basic-features/image-optimization.md#local-images) or images with the [`fill` property](#fill).
177
179
180
+
### alt
181
+
182
+
The `alt` property is used to describe the image for screen readers and search engines. It is also the fallback text if images have been disabled or an error occurs while loading the image.
183
+
184
+
It should contain text that could replace the image [without changing the meaning of the page](https://html.spec.whatwg.org/multipage/images.html#general-guidelines). It is not meant to supplement the image and should not repeat information that is already provided in the captions above or below the image.
185
+
186
+
If the image is [purely decorative](https://html.spec.whatwg.org/multipage/images.html#a-purely-decorative-image-that-doesn't-add-any-information) or [not intended for the user](https://html.spec.whatwg.org/multipage/images.html#an-image-not-intended-for-the-user), the `alt` property should be an empty string (`alt=""`).
The `<Image />` component accepts a number of additional properties beyond those which are required. This section describes the most commonly-used properties of the Image component. Find details about more rarely-used properties in the [Advanced Props](#advanced-props) section.
0 commit comments