Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

react-native-image-carousell

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-image-carousell

A component for image gallery carousell like iOS Photos app

latest
Source
npmnpm
Version
0.1.3
Version published
Maintainers
1
Created
Source

react-native-image-carousell

A component for image gallery carousell like iOS Photos app

Features

  • Has a bottom preview for near photos and will scroll responsively
  • Support zoom
  • Will hide preview when zoomScale > 1
  • Currently iOS support only, check #2
Example.gif

Installation

npm install --save react-native-image-carousell

Usage

import ImageCarousell from 'react-native-image-carousell';

class Example extends React.Component {
  constructor(props) {
    super(props);
    const dataSource = new ListView.DataSource({
      rowHasChanged: (r1, r2) => r1 !== r2,
    });
    this.state = {
      dataSource: dataSource.cloneWithRows([
        require('./images/1.png'),
        require('./images/2.png'),
        require('./images/3.png'),
        require('./images/4.png'),
        require('./images/5.png'),
        require('./images/6.png'),
        require('./images/7.png'),
        require('./images/8.png'),
        require('./images/9.png'),
        require('./images/10.png'),
      ]),
    };
  }
  
  render() {
    return (
      <View style={styles.container}>
        <ImageCarousell
          dataSource={this.state.dataSource}
        />
      </View>
    );
  }
}

Properties

PropTypeDescriptionRequired
dataSourceListView.DataSourceThe image data sourcetrue
initialIndexnumberThe initial image to show based on dataSource index (Default 0)
showPreviewboolTo show bottom image preview (Default true)
previewImageSizenumberPreview image size (Default 80)
widthnumberWidth for ImageCarousell (Default is Dimensions.get('window').width
heightnumberHeight for ImageCarousell (Default is Dimensions.get('window').height
styleView.propTypes.styleCustom style for ImageCarousell
previewContainerStyleView.propTypes.styleCustom style for bottom preview container
imageStyleView.propTypes.styleCustom style for Image
previewImageStyleView.propTypes.styleCustom style for bottom preview image
getImageSourceFromDataSourcefunctionThe getter for each dataSource row. (Default is (row) => row.You could however to use (row) => { uri: row.get('image') } if you use Immutable.js
renderScrollComponentfunctionCustom ScrollView component for ListView

Example

Check Example

License

MIT

Keywords

react-native

FAQs

Package last updated on 04 Aug 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts