npm.io
1.1.2 • Published 4 years ago

@hakuna-matata-ui/image

Licence
MIT
Version
1.1.2
Deps
2
Size
33 kB
Vulns
0
Weekly
0

@hakuna-matata-ui/image

The Image component is used to display images.

Installation

yarn add @hakuna-matata-ui/image

Import component

import { Image } from "@hakuna-matata-ui/image"

Basic Usage

import React from 'react'
import { Image } from '@hakuna-matata-ui/image'const Example = () => (
  <Image src="photo.png"  fallbackSrc="placeholdit.com/200x200" alt="A Placeholder Image" />
)

Fallback support

You can provide a fallback image for when there is an error loading the src of the image. You can also opt out of this behavior by passing the ignoreFallback prop.

<Image
  src="photo.png"
  fallbackSrc="placeholdit.com/200x200"
  alt="A Placeholder Image"
/>

Keywords