Skip to main content

Image

Use images having different sizes, shapes and borders.

Examples

Images can be displayed using the src prop.

  • Note: To change the dimensions of the image, use the width and height props. By default the width and height of the image is 100%
import { Image } from 'chic-ui';

<Image src='cat1.png' width='160px' height='130px' />
<Image src='cat2.png' width='160px' height='130px' />

Shape and Border

The shape of the images can be changed using the rounded and circle props.

Give a cute white outline to the image using the outline prop.

import { Image } from 'chic-ui';

<Image src='cat1.png' width='160px' height='130px' rounded />
<Image src='cat2.png' width='160px' height='130px' circle />
<Image src='cat3.png' width='160px' height='130px' outline />

API

import { Image } from 'chic-ui';
NameTypeDefaultDescription
src (required)stringPath of the image
widthstring'100%'Width of the image
heightstring'100%'Height of the image
roundedbooleanfalseSets image shape as rounded
circlebooleanfalseSets image shape as circle
outlinebooleanfalseProvides white borders to the image
classNamestringProvide external classnames to the component
styleReact.CSSPropertiesOverride default styling of the component