https://github.com/quenice/react-native-cardview
A react-native library for cardview
https://github.com/quenice/react-native-cardview
android cardview ios react-native
Last synced: 4 months ago
JSON representation
A react-native library for cardview
- Host: GitHub
- URL: https://github.com/quenice/react-native-cardview
- Owner: quenice
- Created: 2018-08-31T10:52:29.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2020-08-06T11:44:54.000Z (about 5 years ago)
- Last Synced: 2025-05-25T18:05:03.887Z (4 months ago)
- Topics: android, cardview, ios, react-native
- Language: Java
- Size: 215 KB
- Stars: 21
- Watchers: 2
- Forks: 9
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# react-native-card-view
## Getting started
`$ npm install react-native-rn-cardview --save`
### Mostly automatic installation
`$ react-native link react-native-rn-cardview`
### Manual installation
#### iOS
> no need link
#### Android
1. Open up `android/app/src/main/java/[...]/MainActivity.java`
- Add `import com.quenice.reactnative.RNCardViewPackage;` to the imports at the top of the file
- Add `new RNCardViewPackage()` to the list returned by the `getPackages()` method
2. Append the following lines to `android/settings.gradle`:
```
include ':react-native-rn-cardview'
project(':react-native-rn-cardview').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-rn-cardview/android')
```
3. Insert the following lines inside the dependencies block in `android/app/build.gradle`:
```
compile project(':react-native-rn-cardview')
```## Usage
### example
```javascript/**
* Sample React Native CardView
*
*/
import React, {Component} from 'react';
import {Platform, StyleSheet, Text, View} from 'react-native';
import CardView from 'react-native-rn-cardview'export default class App extends Component {
render() {
return (
ReactNative CardView for iOS and Android
This is test
);
}
}```
### screenshots
#### iOS

#### android
## Attributes
Name | Type | Desc
---|---|---
cardElevation | Number | the elevation of the card view
maxCardElevation | Number | if not set, equals the ``` cardElevation ``` default
radius | Number | the border radius of the card view
backgroundColor | String | the background color of the card view