Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/dondoko-susumu/react-native-card-media

Card Media component for React Native
https://github.com/dondoko-susumu/react-native-card-media

card-media image javascript react-native ui-components

Last synced: about 2 months ago
JSON representation

Card Media component for React Native

Awesome Lists containing this project

README

        

## react-native-card-media
Card Media component for React Native. Also supports multiple image layout.

#### single & double

![single & double](images/single_double.png)

#### three & four

![three & four](images/three_four.png)

#### five

![five](images/five.png)

## Installation

`npm install react-native-card-media --save`

## Examples
[CardMediaExample](https://github.com/dondoko-susumu/react-native-card-media-example/blob/master/App.js)

## Usage
```javascript
const files5 = [
`${path}kids_play_640.jpeg`,
`${path}road_640.jpg`,
`${path}women_640.jpeg`,
`${path}sea_kids_640.jpeg`,
`${path}temple_640.jpeg`,
];

this.onPress(fileIndex)}
imageIconView={this.renderImageIconView}
imageCountStyle={{ fontSize: 20, fontWeight: '500', lineHeight: 28, color: '#fafafa' }}
imageTouchable={false}
/>
```

## Props
| Prop | Description | Type | Default |
| ------------- | ------------- | ------------- | ------------- |
| **files** | Media lists | Array | **Required** |
| **style** | CardView style | View Style Object | undefined |
| **title** | Title text is shown at below part of card | String | undefined |
| **showTitle** | Title is shown or not | Boolean | true |
| **titleStyle** | Title style | View Style Object | undefined |
| **onPress** | Action is called when click in card
you can pass the file index as an argument| Function | undefined |
| **imageIconView** | Icon is shown near title | Component | undefined |
| **imageCountStyle** | Icon style | View Style Object | undefined |
| **imageTouchable** | Images in card is clickable or not | Boolean | true |

## License
MIT