Skip to content

Latest commit

 

History

History
executable file
·
82 lines (75 loc) · 2.78 KB

Thumbnail.md

File metadata and controls

executable file
·
82 lines (75 loc) · 2.78 KB

Thumbnail

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

Preview ios Thumbnail Preview android Thumbnail

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