1.0.3 • Published 5 years ago

@ticmakers-react-native/input v1.0.3

Weekly downloads
-
License
BSD-3-Clause
Repository
bitbucket
Last release
5 years ago

TIC Makers - React Native Input

React native component for input.

Powered by TIC Makers

Demo

Input Expo's snack

Install

Install @ticmakers-react-native/input package and save into package.json:

NPM

$ npm install @ticmakers-react-native/input --save

Yarn

$ yarn add @ticmakers-react-native/input

How to use?

import React from 'react'
import { AppLoading, Font } from 'expo'
import Input from '@ticmakers-react-native/input'

export default class App extends React.Component {
  userInput = null
  passInput = null

  render() {
    return (
      <View>
        <Input
          lang="es"
          label="Username"
          ref={ c => this.userInput = c }
          iconLeft={{ name: 'account-circle', type: 'material-community' }}
          rules={{ required: true, minLength: 3, maxLength: 8, email: true }}
        />

        <Input
          password
          label="Password"
          ref={ c => this.passInput = c }
          iconLeft={{ name: 'key', type: 'material-community' }}
          rules={{ required: true, minLength: 3, maxLength: 8 }}
        />
      </View>
    )
  }

  getValues() {
    return ({
      user: userInput.value,
      pass: passInput.value,
    })
  }
}

Properties

NameTypeDefault ValueDefinition
name---

Todo

  • Test on iOS
  • Improve and add new features
  • Add more styles
  • Improve readme (example & demo)
  • Create tests

Version 1.0.3 (Changelog)