1.0.5 • Published 1 year ago

green-native v1.0.5

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

GREEN NATIVE

Intall

npm i green-native react-native-vector-icons

Require

npx react-native-link

AnimationButton

Simple buttom

import { AnimationButton } from "green-native";

<AnimationButton
  animation="zoom-out"
  text="Green Native"
  background="red"
  paddingHorizontal={15}
  paddingVertical={10}
  radius={6}
/>;

Using CustomComponents

import { AnimationButton } from "green-native";

<AnimationButton
  animation="zoom-in"
  CustomComponents={() => (
    <View
      style={{
        padding: 10,
        backgroundColor: "red",
        alignItems: "center",
        justifyContent: "center",
      }}
    >
      <Text style={{ fontSize: 18 }}>Green Native</Text>
    </View>
  )}
/>;

Available props

NameTypeDefault
textstring: text center buttonnone
colorcolor#fff
widthnumbernone
heightnumbernone
fontSizenumber16
backgroundcolor#28C953
radiusnumber0
isBoldbooleanfalse
paddingHorizontalnumber5
paddingVerticalnumber5
fontFamilystring: font namenone
animationstring: zoom-in, zoom-outzoom-in
onPressfunctionconsole.log(Green Native)
CustomComponentsElementnone

Icon

import { Icon } from "green-native";

<Icon type="Ionicons" name="camera" size={30} color={Colors.purpleDark} />;

Available props

Require react-native-vector-icons

Icons can be found at: https://oblador.github.io/react-native-vector-icons

NameTypeDefault
typestring: AntDesign, FontAwesome...Ionicons
namestring: camera, filter...flask-sharp
sizenumber18
colorcolor#28C953

CheckBox

import { Colors, CheckBox } from "green-native";

const GreenMaster = () => {
  const [status, setStatus] = React.useState(false);

  return (
    <View>
      <CheckBox
        checked={status}
        text="This this Green Native CheckBox"
        textColor={Colors.messenger}
        iconColor={Colors.green}
        iconCheckedColor={Colors.orange}
        onPress={() => {
          setStatus(!status);
        }}
      />
    </View>
  );
};

Available props

NameTypeDefault
textstring: text right of iconnone
checkedbooleanfalse
iconTypestring: AntDesign, FontAwesome...MaterialCommunityIcons
iconNamestring: camera, rocket...checkbox-blank-outline
iconCheckedNamestring: camera, rocket...checkbox-marked
iconColorcolor#607D8B
iconCheckedColorcolor#28C953
iconSizenumber30
textSizenumber16
textColornumber#28C953
onPressfunctionconsole.log(Green Native)
activeOpacitynumber0.5

Colors

import { Colors } from "green-native";

<Text style={{ color: Colors.green, fontSize: 18 }}>Green Native</Text>;

Available props

NameColor
transparentrgba(0,0,0,0)
trans05rgba(0,0,0,0.05)
trans50rgba(0,0,0,0.5)
primaryColor#28C953
red#F44336
blue#2196F3
pink#E91E63
orange#FF5722
blueGrey#607D8B
purple#9C27B0
blueGrey#607D8B
borderColor#ECEFF1

Light or dark colors can be used

<Text style={{ color: Colors.orangeDark, fontSize: 18 }}>Green Native</Text>

Social network color

<Text style={{ color: Colors.youtube, fontSize: 18 }}>Green Native</Text>

Button

import { Colors, Button } from "green-native";

<Button
  isOutLine={true}
  background={Colors.orange}
  boder={1}
  boderColor={Colors.green}
  radius={4}
  onPress={() => {
    console.log("This is handle");
  }}
/>;

Available props

NameTypeDefault
textstring: text center buttonnone
widthnumbernone
heightnumbernone
backgroundcolor#28C953
textColorcolor#fff
textBoldbooleanfalse
fontSizenumber14
radiusnumber0
bodernumber0
boderColorcolor#28C953
isOutLinebooleanfalse
isDarkbooleanfalse
isLightbooleanfalse
onPressfunctionconsole.log(Green Native)

Spinner

import { Colors, Spinner } from "green-native";

<Spinner
  type="full"
  size="small"
  transparent={true}
  color={Colors.orangeDark}
/>;

Available props

NameTypeDefault
typestring: full, fullscreen -> full screen100%
transparentbooleanfalse -> backgroundColor: '#fff'
widthnumberfullscreen
heightnumberfullscreen
colorcolor#28C953
sizestring: large, smalllarge

ButtonIcon

import { Colors, ButtonIcon } from "green-native";

<ButtonIcon
  text="This is Green Native"
  textColor={Colors.black}
  textSize={20}
  onPress={() => {
    console.log("This is Green Native");
  }}
/>;

Available props

NameTypeDefault
textstring: text on right of icon100%
iconTypestring: AntDesign, FontAwesome...false -> backgroundColor: '#fff'
iconNamestring: camera, roket..fullscreen
iconColorcolor#28C953
iconSizenumber26
textColorcolor#28C953
textSizenumber16
isBoldbooleanfalse
onPressfunctionconsole.log(Green Native)
paddingHorizontalnumber0
paddingVerticalnumber0
activeOpacitynumber0.5

ErrorNotification

import { Colors, ErrorNotification } from "green-native";

<ErrorNotification
  text="Please enter password"
  color={Colors.redLight}
  fontSize={18}
/>;

Available props

NameTypeDefault
textString, numbernone
colorcolor#28C953
fontSizenumber14
isBoldbooleanfalse
marginVerticalnumber0
marginHorizontalnumber0

Hook

useKeyboard

import { useKeyboard } from "green-native";

const keyboard = useKeyboard(); // true, false

Other

screenHeight, screenWidth

import { screenHeight, screenWidth } from "green-native";

<View style={{ width: screenWidth, height: screenHeight }} />;

windowHeight, windowWidth

import { windowHeight, windowWidth } from "green-native";

<View style={{ width: windowWidth, height: windowHeight }} />;

GreenStyles: Center, Row, ColumCenter, ShadowBox, Title

Function

NameTypeInputOutput
isIOSfunctiontrue - false
is18x9functiontrue - false
isNullfunctiontrue - false
saveToStoragefunctionString: name, value
getFromStoragefunctionString: nameString
PhoneCallfunctionString: phone numberOpen phone call
parseMoneyfunctionString, number: 6900069.000

Contact

NGUYEN PHUC BAO CHAU

Keyword

baochau9xx, green, green-native, green native, react-native, native, baochau, dovuihainao