Duolith docs

Errors while checking a page

E0160 Image without a description

Message <element> needs alt, or decorative

Words in italics are filled in when the compiler reports it, such as the element's name or the list of known ones.

Why

Screen reader users hear an image's alt text instead of seeing it, so every image says what it shows. An image that only decorates, and adds nothing they need, is marked decorative and is skipped. A component that declares both an alt and a decorative prop, such as the kit's Image, is held to the same rule. An empty alt="", alt=undefined and decorative=false count as absent.

How to fix it

Add alt="..." saying what the image shows, such as alt="Ada at the summit", or decorative if it adds nothing.

In a terminal

duolith explain E0160

Mentioned in