`S3Image` component renders an *Amazon S3 object key* as an image:
```jsx
import { S3Image } from 'aws-amplify-react';
render() {
return
}
```
For private images, supply the `level` property:
```jsx
return
```
To show another user's protected image, supply that user's `identityId` property as well:
```jsx
return
```
To initiate an upload, set the `body` property:
```jsx
import { S3Image } from 'aws-amplify-react';
render() {
return
}
```
To hide the image shown in the S3Image, set `hidden`:
```jsx
import { S3Image } from 'aws-amplify-react';
render() {
return
}
```
**Image URL**
`S3Image` converts path to actual URL. To get the URL, listen to the `onLoad` event:
```jsx
console.log(url)} />
```
**Photo Picker**
Set `picker` property to true on `S3Image`. A `PhotoPicker` let the user pick a picture from the device. After users picks an image, the image will be uploaded with `imgKey`.
```jsx
```
When you set `path`, the *key* for the image will be the combination of `path` and image file name.
```jsx
```
To generate a custom key value, you can provide a callback:
```jsx
function fileToKey(data) {
const { name, size, type } = data;
return 'test_' + name;
}
...
```
`S3Image` will escape all spaces in key values to underscore. For example, 'a b' will be converted to 'a_b'.