React Native Gradient Card View| Expo

0

React Native Gradient Card View

Battle Tested ✅

Fully customizable Gradient Card View for React Native

npm version npm expo-compatible Platform - Android and iOS License: MIT

React Native Gradient Card View

Installation

Add the dependency:

Pure React Native:

npm i react-native-gradient-card-view

Expo Version:

"react-native-gradient-card-view": "WrathChaos/react-native-gradient-card-view#expo"

Peer Dependencies

IMPORTANT! You need install them.
"react-native-linear-gradient": ">= 2.x.x"

#Expo Version Peer Dependencies:

"react-native-expo-image-cache": ">= 3.x.x"

Basic Usage

<GradientCard />

Advanced Usage

You can check the example for the advanced usage

<GradientCard
  style={{ marginTop: 16 }}
  title={item.name}
  subtitle={item.shortName}
  centerTitle={item.value}
  centerSubtitle={item.change}
  rightComponent={
    <LineChart
      data={item.data}
      style={styles.chartStyle}
      contentInset={styles.chartContentInset}
      svg={{
        strokeWidth: 1.5,
        fill: item.fillColor,
        stroke: item.strokeColor,
      }}
    />
  }
/>

Configuration - Props

PropertyTypeDefaultDescription
gradientColors[color]check the examplechange the gradient's color array
stylestylenulladd any style to the whole container
shadowStylestylecheck the exampleset your own shadow style
shadowColorcolor#595959change the shadow color
outerContainerstylestyleset your own outer container style (NOT recommended!)
widthnumberdevice width * 0.95change the card's width
heightnumber70change the card's height
borderRadiusnumber20change the card's border radius
innerContainerStylestylestyleset your own inner container style (NOT recommended!)
imageComponentStylecomponentFastImageset your own image component
imageStylestylestylechange the image's style
imageWidthnumber35change the image's width
imageHeightnumber35change the image's height
imageBorderRadiusnumber10change the image's border radius
imageSourcefiledefault imageset your own image source
titlestring"BTC"change the title string with your data
subtitlestring"Bitcoin"change the subtitle string with your data
centerTextstring"$ 4081,95"change the center title string with your data
centerSubtextstring"+ 1,48 ↑"change the center subtitle string with your data
titleTextStylestylestyleset your own style for title component
subtitleTextStylestylestyleset your own style for subtitle component
leftComponentcomponenttext based componentset your component for the left part
centerTextStylestylestyleset your own style for center title component
centerSubtextStylestylestyleset your own style for center subtitle component
centerComponentcomponenttext based componentset your component for the center part
rightComponentcomponentnullset your own component for the right component

ToDos

  •  Make an Expo Version
  •  LICENSE
  •  Write an article about the lib on Medium

Author

FreakyCoder, kurayogun@gmail.com

License

React Native Gradient Card View Library is available under the MIT license. See the LICENSE file for more info.

Post a Comment

0Comments
Post a Comment (0)