0.1.3 • Published 3 years ago

@freakycoder/react-native-colorful-card v0.1.3

Weekly downloads
85
License
MIT
Repository
github
Last release
3 years ago

Battle Tested ✅

React Native Colorful Card

npm version npm Platform - Android and iOS License: MIT styled with prettier

Installation

Add the dependency:

npm i @freakycoder/react-native-colorful-card

Peer Dependencies

"@freakycoder/react-native-bounceable": ">= 0.2.4"

Usage

Import

import ColorfulCard from "@freakycoder/react-native-colorful-card";

Fundamental Usage

<ColorfulCard
  title="Sleep"
  value="8"
  valuePostfix="h 42 m"
  footerTitle="Deep Sleep"
  footerValue="3h 13m"
  iconImageSource={require("./assets/sleep.png")}
  style={{ backgroundColor: "#7954ff" }}
  onPress={() => {}}
/>

Example Project 😍

You can checkout the example project 🥰

Simply run

  • npm i
  • react-native run-ios/android

should work of the example project.

Configuration - Props

Fundamentals

PropertyTypeDefaultDescription
titlestringundefinedchange the title string
valuestringundefinedchange the value string
valuePostfixstringundefinedchange the value postfix string
footerTitlestringundefinedchange the footerTitle string
footerValuestringundefinedchange the footerValue string
iconImageSourceimageundefinedset your own image source for the icon
onPressfunctionundefinedset your own logic for the button functionality when it is pressed

Customization (Optionals)

PropertyTypeDefaultDescription
styleViewStyledefaultset or override the style object for the main container
iconImageStyleImageStyledefaultset or override the image style object for the icon container
titleTextStyleTextStyledefaultset or override the text style object for the title text
footerTextStyleTextStyledefaultset or override the text style object for the footer text
valueTextStyleTextStyledefaultset or override the text style object for the value text
valuePostfixTextStyleTextStyledefaultset or override the text style object for the value postfix text
ImageComponentImagedefaultset your own component instead of default react-native Image component

Future Plans

  • LICENSE
  • Write an article about the lib on Medium

Author

FreakyCoder, kurayogun@gmail.com

Credits

Heavily inspired by WebFrontEndTips

License

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