Skip to main content

Image

Image is a wrapper for the native image tag with support for events and fallback images.

Always provide alt text for your users, unless the image is purely decorative, in which case the alt text should be an empty string ("") to hide it from screen readers.

Live Editor
function ImageExample() {
  return (
    <Image
      alt='The reception area of the Sprout Social office.'
      src='/example-photo.jpg'
      m={0}
    />
  );
}

Properties

NameTypeDefaultDescriptionRequired?
srcstringYes
altstringAlt text is required for non-decorative imagesYes
titlestringYes
onError(e: SyntheticEvent<HTMLImageElement, Event>) => voidYes
onClick() => voidYes
defaultImagestringA URL for a default image to load if the source image is not available
onLoad() => voidYes
qaobject

Properties

info

Full property documentation will be added soon.