0.0.25 • Published 6 years ago

react-ui-kit-native v0.0.25

Weekly downloads
29
License
MIT
Repository
github
Last release
6 years ago

React Native UI Kit

React Native components based on React UI Kit

Offical documentation of React UI Kit Native made for React Native applications and you can easily use the components in your project. A lot of predefined styles & properties so it's perfectly fit for prototyping of your app UI.

Support: contact@react-ui-kit.com

Setup

Install & usage

  1. Install local module with react-ui-kit-native (it will also download all required dependencies)
npm install react-ui-kit-native --save
  1. Use any component you want, all available props are available separately for each component below in this documentation. For example:
import React from 'react';
import { Button } from 'react-ui-kit-native';

export default class MyButton extends React.Component {
  render() {
    return (
      <Button full primary rounded label="My button" />
    );
  }
}

Components

List of available components:

StatusTypeComponentDescription
:heavy_check_mark:buttonButtonreact-native TouchableOpacity component with predefined styles & props
:heavy_check_mark:buttonLinkreact-native Text & Linking component with predefined properties
:heavy_check_mark:inputInputreact-native TextInput component with predefined styles & props
:heavy_check_mark:inputSelectreact-native-modal-dropdown module with predefined styles
:soon:inputCheckboxreact-native Switch component with predefined styles & props
:soon:inputDatepikerreact-native DatePickerIOS & DatePickerAndroid component with predefined styles & props
:soon:inputProgressreact-native ProgressViewIOS & ProgressBarAndroid component with predefined styles & props
:heavy_check_mark:viewBlockreact-native View component with predefined styles & props
:heavy_check_mark:viewContainerreact-native View component with predefined styles & props
:heavy_check_mark:viewTextreact-native Text component with predefined styles & props
:heavy_check_mark:viewIconreact-native-vector-icons module with predefined props
:heavy_check_mark:viewImagereact-native Image component with predefined styles & props
:construction:viewBadgereact-native Text & View component with predefined styles & props
:construction:viewLabelreact-native Text & View component with predefined styles & props
:soon:viewTabsreact-native TabBarIOS component with predefined styles & props
:soon:viewListreact-native ScrollView component with predefined styles & props
:soon:viewMenureact-native ScrollView component with predefined styles & props

Button

PROPTYPEDEFAULTDESCRIPTION
colorstring#FFFFFFSpecifies a text color
sizenumber16Specifies a fontSize size
labelstringnullSpecifies a string for the button text
iconboolnullSpecifies an icon name - check Icon component
familyboolnullSpecifies an icon family - check Icon component
loadingboolfalseDisable touch/press events and render ActivityIndicator
fullboolfalseSet the width of the component to 80% from the total width of the screen
opacitynumber0.8Determines what the activeOpacity of the Button should be when touch is active
basicboolfalseInclude styles.basic with backgroundColor: #FFFFFF, borderColor: #45547e
boldboolfalseDetermines whether the styles.bold should be included
borderboolfalseDetermines whether the styles.border should be included
roundedboolfalseDetermines whether the styles.basic should be included
primaryboolfalseInclude styles.primary with backgroundColor: #7CB527
secondaryboolfalseInclude styles.secondary with backgroundColor: #FF3D57
tertiaryboolfalseInclude styles.tertiary with backgroundColor: #7857A9
styleView style{}Add style properties for better customization

For more properties visit TouchableOpacity props

Link

PROPTYPEDEFAULTDESCRIPTION
colorstringcolor: #323642 Specifies a text color
hrefstringnullA link (web URL, email, contact etc.)
onPressfunc() => {}Called when the touch is released
styleView style{}Add style properties for better customization

Input

PROPTYPEDEFAULTDESCRIPTION
colorstring#293042 Specifies a text color
placeHolderColorstring#5E6D95 Specifies a placeholderTextColor
bgColorstring#FFFFFFSpecifies a backgroundColor color
roundedboolfalseDetermines whether the styles.rounded should be included
typestringdefaultOne of 'default', 'email-address', 'numeric', 'phone-pad', 'number-pad', 'decimal-pad' for keyboardType
helpstringnullSpecifies a string or node for the text positioned between label and input
leftbooltruePositioning the icon on the left
rightboolfalsePositioning the icon on the right
transparentboolfalseDetermines whether the styles.transparent should be included
borderlessboolfalseDetermines whether the styles.borderless should be included
borderboolfalseDetermines whether the styles.border should be included

For more properties visit TextInput props

Text

PROPTYPEDEFAULTDESCRIPTION
h1boolfalsestyles.h1 with fontSize size of 112
h2boolfalsestyles.h2 with fontSize size of 56
h3boolfalsestyles.h3 with fontSize size of ~45
h4boolfalsestyles.h4 with fontSize size of ~34
h5boolfalsestyles.h5 with fontSize size of ~24
titleboolfalsestyles.title with fontSize size of ~20
subtitleboolfalsestyles.subtitle with fontSize size of 16
captionboolfalsestyles.caption with fontSize size of 12
sizenumber14Specifies a fontSize size of 14
colorstring#808080 Specifies a text color #808080
thinboolfalseSet the fontWeight to 100
boldboolfalseSet the fontWeight to 300
lightboolfalseSet the fontWeight to bold
italicboolfalseSet the fontStyle to italic
alignboolnullSpecifies a textAlign

For more properties visit Text props

Icon

PROPTYPEDEFAULTDESCRIPTION
colorstring#808080 Specifies an Icon color COLOR_DEFAULT #808080
sizenumber16Specifies a fontSize size, BASE_SIZE 16px
namestringnull` | What icon to show, for more example see Icon Explorer
familystringnull` | One of the sets from Bundled Icon Sets

For more properties visit react-native-vector-icons

Image

PROPTYPEDEFAULTDESCRIPTION
avatarstringfalseBased on image width & height will add borderRadius with value of minimum between WIDTH & HEIGHT
widthnumbernullAdd WIDTH to image style
heightnumbernullAdd HEIGHT to image style
sizenumbernullwidth & height changed using: tiny divided by 2, small divided by 1.25 or large multiplied by 2
sourcestringnullImage source (either a remote URL or a local file resource).

For more properties visit Image props

Examples

A list of example screens based on the above components:

Login

Login Screen

import React from 'react';
import { Block, Button, Input, Text } from 'react-ui-kit-native';

export default class LoginScreen extends React.Component {
  render() {
    return (
      <Block flex middle>
        <Text title light color="#000">
          LOGIN SCREEN
        </Text>
        <Text caption thin color="#000">
          Please login to your account
        </Text>
        <Input placeholder="Email" />
        <Input password placeholder="Password" />
        <Button full primary rounded label="SIGN IN" />
      </Block>
    );
  }
}

Forgot

Forgot Screen

import React from 'react';
import { Block, Button, Input, Text } from 'react-ui-kit-native';

export default class LoginScreen extends React.Component {
  static navigationOptions = {
    header: null,
  };

  render() {
    return (
      <Block flex middle>
        <Text title light color="#000">
          FORGOT PASSWORD
        </Text>
        <Input placeholder="Email" />
        <Button full rounded label="RESET PASSWORD" />
      </Block>
    );
  }
}

Register

Register Screen

import React from 'react';
import { Block, Button, Input, Text } from 'react-ui-kit-native';

export default class RegisterScreen extends React.Component {
  render() {
    return (
      <Block fluid flex middle>
        <Text title light color="#000">
          REGISTER SCREEN
        </Text>
        <Input label="First name" placeholder="React" right icon="text" family="Entypo" />
        <Input label="Last name" placeholder="UI Kit" right icon="text" family="Entypo" />
        <Input
          right
          icon="location-pin"
          family="Entypo"
          label="Address"
          placeholder="Street name, number, house"
        />
        <Input
          right
          icon="phone"
          family="Entypo"
          type="phone-pad"
          label="Phone number"
          placeholder="0712345678"
        />
        <Button full rounded tertiary label="SIGN UP" />
      </Block>
    );
  }
}

Profile

Profile Screen

import React from 'react';
import { StyleSheet, Image } from 'react-native';
import { Block, Text } from 'react-ui-kit-native';

class ProfileScreen extends React.Component {
  render() {
    const { profile } = this.props;

    return (
      <Block fluid flex middle style={styles.profile}>
        <Text h5 light color="#000">{profile.fullname}</Text>
        <Image source={{ uri: profile.avatar }} style={styles.avatar} />
        <Text subtitle light>{`${profile.city}, ${profile.country}`}</Text>
        <Text bold>{profile.email}</Text>
      </Block>
    );
  }
}

ProfileScreen.defaultProps = {
  profile: {
    fullname: `React UI Kit`,
    city: `London`,
    country: `United Kingdom`,
    email: `contact@react-ui-kit.com`,
    avatar: `https://react-ui-kit.com/assets/img/react-ui-kit-logo.png`,
  },
};

export default ProfileScreen;

const styles = StyleSheet.create({
  profile: {
    paddingTop: 15,
    backgroundColor: '#fff',
  },
  avatar: {
    width: 200,
    height: 200,
    resizeMode: 'contain',
  },
});

Work in progress

  • export components style as styles for easy import
  • create theme HoC with default theme.js

Contribution

Have an idea for a new component or Screen? Just contact us at contact@react-ui-kit.com and will add it to our list.

0.0.25

6 years ago

0.0.24

6 years ago

0.0.23

6 years ago

0.0.22

6 years ago

0.0.21

6 years ago

0.0.20

6 years ago

0.0.19

6 years ago

0.0.18

6 years ago

0.0.17

6 years ago

0.0.16

6 years ago

0.0.15

6 years ago

0.0.14

6 years ago

0.0.13

6 years ago

0.0.12

6 years ago

0.0.11

6 years ago

0.0.10

6 years ago

0.0.9

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago