File size: 1,206 Bytes
1e92f2d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
---
title: Image
description: Used to display images
---
<ExampleTabs name="image-basic" />
## Usage
```js
import { Image } from "@chakra-ui/react"
```
```jsx
<Image src="..." />
```
## Examples
### Height
Use the `height` prop to change the height of the image component.
<ExampleTabs name="image-with-height" />
### Circular
Here's an example of how to render a circular image.
<ExampleTabs name="image-circular" />
### Aspect Ratio
Use the `aspectRatio` prop to change the aspect ratio of the image component.
<ExampleTabs name="image-with-aspect-ratio" />
### Fit
By default, the image applies `object-fit: cover`. Use the `fit` prop to change
the fit of the image component.
<ExampleTabs name="image-with-fit" />
### HTML Width and Height
Use the `htmlWidth` and `htmlHeight` props to set the native width and height of
the image component.
<ExampleTabs name="image-with-html-height" />
### Next.js Image
Use the `asChild` prop to render the image as a child of the `Image` component.
```jsx
// import NextImage from "next/image"
<Image asChild>
<NextImage src="..." alt="..." />
</Image>
```
## Props
The `Image` component supports all native props for the `img` element.
|