Thumbnail component works very similar to Image. It helps you to showcase an image with variuos dimensions and shapes. By default, Thumbnail renders an image in circular shape.
Replacing Component: React Native Image
Syntax
import React, { Component } from 'react';
import { Container, Header, Content, Thumbnail, Text } from 'native-base';
export default class ThumbnailExample extends Component {
render() {
const uri = "https://facebook.github.io/react-native/docs/assets/favicon.png";
return (
<Container>
<Header />
<Content>
<Text>Square Thumbnail</Text>
<Thumbnail square source={{uri: uri}} />
<Thumbnail square small source={{uri: uri}} />
<Text>Circular Thumbnail</Text>
<Thumbnail source={{uri: uri}} />
<Thumbnail large source={{uri: uri}} />
</Content>
</Container>
);
}
}Note: To have Thumbnail of custom size, include height and width with style.
Configuration
| Property | Default | Option | Description |
|---|---|---|---|
| source | - | - | Image path for thumbnail. |
| circle | true | - |
Represents shape of thumbnail. By default thumbnail is circle in shape. |
| square | - | - | Represents shape of thumbnail |
| small | - | - | Small thumbnail with width and height of 36px |
| large | - | - | Large thumbnail with width and height of 80px |