0.1.16 • Published 6 years ago

@app-masters/react-native-ui-kit v0.1.16

Weekly downloads
-
License
ISC
Repository
github
Last release
6 years ago

React Native UI Kit

This is an UI kit for React Native with the common components used in App Masters.

Components

  • Button
  • Card
  • Divider
  • Input Field
  • Offline Image
  • Spinner
  • Style Utils

Usage

Before start, you must have a style file like (?).

$ npm install @app-masters/react-native-ui-kit --save-dev

Import your styles files and startStyles:

import { startStyles } from '@app-masters/react-native-ui-kit';
import AppStyles from './styles/styles';

In your app constructor:

startStyles(AppStyles);

Description

Button

Conditional button with style of Android and iOS

PropsDefaultDescription
style-Optional A custom style for that will override any default in the button container
onPress-Button's callback
label-Button's text
image-Optional Icon that will apear before the label
subText-Optional Label caption
subTextStyle-Optional Style for the caption
imageColor-Optional Color of icon
primaryColor-Background color when raised. When not, color of text.
secondaryColor-Color when pressed.
textColor-Color of text
raisedfalseWhen raised, background color is shown.

Card

Simple material design card.

PropsDefaultDescription
children-Card content
horizontalfalseIf horizontal, card will not have horizontal border.
style-Optional Custom styles that will override the default
onPress-Optional Callback for when the card is pressed

Divider

Simple material design horizontal divider

Input Field

Pretty Input field

PropsDefaultDescription
style-Optional Custom style that will override the container's style
value-Value of input
autoCapitalizefalseSet the first characters to upper case
maxLength-Maximun number of characters
keyboardType-Optional Set the keyboard type
onChangeText-Callback for changing in the text
placeholder-Optional Text when nothing is typed
secureTextEntryfalseIf true, hide the characters (password)
icon-Optional Icon that will be shown in the right of input
primaryColor-Color of icon and border
errorfalseIf true, error message will be shown and color will change
errorMessage-Message to show the error
errorColor-Color override in error
suffix-Optional Suffix text

Offline Image

Image component with that will load an online image and show an animation. If no online or fail to get, an offline image will be shown in the place.

PropsDefaultDescription
online-Image link for online get
offline-Offline default image
style-Optional Custom style that will override the container's style

Spinner

View with a spinner for loading states

PropsDefaultDescription
color-Optional Color of Spinner
screenfalseIf true, spinner will be larger

Style Utils

Functions used for creation of default styles

FunctionsParamsDescription
startStyles(appStyles)Create a object will default styles and merge with all custom app styles.
Styles-Static object will all app styles
ScreenSize-Static object with screen size of phone: {width, height}
isPortrait( )Return true if Portrait
isLandscape( )Return true if Landscape
screenPosition( )Return "LANDSCAPE" or "PORTRAIT"
0.1.16

6 years ago

0.1.15

6 years ago

0.1.14

6 years ago

0.1.13

6 years ago

0.1.12

6 years ago

0.1.11

6 years ago

0.1.10

6 years ago

0.1.9

6 years ago

0.1.8

6 years ago

0.1.7

6 years ago

0.1.6

6 years ago

0.1.5

6 years ago

0.1.4

6 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago