Skip to main content
Brand and assets
Build
Monitor and contribute
/
Component library
  • All components
  • Buttons & actions
  • Forms & inputs
  • Layout & containers
  • Overlays
  • Feedback & status
  • Data display
    • Accordion
    • Accordion
    • Avatar
    • Avatar
    • Blobby
    • Card
    • Card
    • Collapsible
    • Divider
    • Emoji
    • Emoji
    • Gradient
    • Gradient
    • Icon
    • Image
    • ListItem
    • ListItem
    • ResponsiveImage
    • SemanticList
    • Tag
    • Timeline
  • Typography
  • Accessibility
  • Contrib
  • Deprecated
  • Data display
  • Image

Image

Use it like an `<img>`, with extra handling built in. `alt` defaults to empty, so set it whenever the image carries meaning.

Health
Component health
Source
View on Github
Storybook
View in Storybook
Playground
No Example
Accessibility

compliant

Platform
Web
  • Overview
  • Props

Use it exactly like an <img /> but it has under-the-hood logic. For now, we defaulted the alt to be an empty string.

<Image src="https://picsum.photos/id/237/600/300" />

Accessibility​

  1. The image accessibility has a fundamental rule, always specify an alt attribute, however the URL will be read by assistant technology.
  2. But decorative image should have an empty alt attribute, however the content will be polluted by unnecessary information, like "something logo", "someone is looking at a chart on a whiteboard"... More about decorative images in the dedicated section: Decorative images.

We almost always use decorative images, then to simplify the task, alt is defaulted to an empty string.

The image doesn't bring any context​

Generally, if the image doesn't contain textual information, you shouldn't specify the alt. Adding an alt will bring noise for assistive technology like screen readers.

Let's consider we have this image:

Don't

<Image src="https://picsum.photos/id/237/600/300" alt="A nice picture of a dog" />

Do

Because it doesn't bring any additional information.

<Image src="https://picsum.photos/id/237/600/300" />

The image brings context​

If your image contains textual information, or in really specific cases the content of the image brings context. Then you can specify the alt.

Let's consider we have this image:

Don't

Not specifying an alt will cause a loss of information.

<Image src="/static/img/component-image-example1.png" />

Do

Provide a brief alt description summarizing the image content in a concise sentence.

<Image
src="/static/img/component-image-example1.png"
alt="Zoo repartition is composed by 5 tigers and 10 elephants"
/>

Image with a lot of information​

In that kind of case, you should structure the information outside of the alt, with regular HTML elements.

Let's consider we have this image:

Transcribing the entire content of this image in the alt attribute is not feasible. In such cases, do not set the alt attribute and instead describe the image content above it.

These cases are rare and do not have a universal solution. If you come across such a scenario, feel free to reach out to @accessibility_help on Slack.


Playground​

Loading...

Undocumented props

NameTypeDefault ValueDescriptionUsage count
altany
aria-hiddenany
classNameany
cssany
heightany
loadingany
roleany
srcany
styleany
widthany
Edit this page
Previous
Icon
Next
ListItem
  • Accessibility
    • The image doesn't bring any context
    • The image brings context
    • Image with a lot of information
  • Playground