1.1.1 • Published 4 years ago

mfrag38-react-native-textinput-with-icons-full v1.1.1

Weekly downloads
1
License
MIT
Repository
-
Last release
4 years ago

MFRAG38 Material Text Input With Icons npm

Based On Material Text Input With Icons By Abdalla Emad Eldin

component for React Native (iOS & Android).

Usage

import React, { Component } from 'react';
import TextInput from 'mfrag38-react-native-textinput-with-icons-full';

export default class Example extends Component {
	state = {
		name: '',
	};

	render() {
		let { name } = this.state;

		return (
			<TextInput
				label='Name'
				// RTL must used when label in arabic ex: label="اللغة العربيه"
				leftIcon='thumbsup'
				leftIconType='oct'
				rippleColor='blue'
				rightIcon='react'
				rightIconType='material'
				value={name}
				refrance={refrance => {
					this.input = refrance;
				}}
				onChangeText={name => this.setState({ name })}
			/>
		);
	}
}

Supported Icons

Ionicons by Ben Sperry (v4.2.4, 696 icons)\ Octicons by Github, Inc. (v8.0.0, 177 icons)\ Evilicons by Alexander Madyankin & Roman Shamin (v1.10.1, 70 icons)\ FontAwesome by Dave Gandy (v4.7.0, 675 icons)\ MaterialCommunityIcons by MaterialDesignIcons.com (v2.8.94, 2894 icons)

Installation

1- Run yarn add mfrag38-react-native-textinput-with-icons-full

  #OR
  #npm install --save mfrag38-react-native-textinput-with-icons-full

2- Run react-native link react-native-vector-icons

Properties

Attention

    You must use RTL prop where label in arabic

Container

nametypedefault
containerWidthNumber
containerMinWidthNumber150
containerMaxWidthNumberscreenWidth - '20%'
containerMaxHeightNumber150
containerMarginBottomNumber0

Label

nametypedefault
labelString
labelDurationNumber200
labelColorStringgray
labelActiveTopNumber-18
labelActiveColorString#3f51b5
labelActiveScaleNumber0.8

Placeholder

NameTypeDefault
placeholderString
placeholderColorStringgray

Input

NameTypeDefault
minHeightNumber
heightNumber
maxHeightNumber
marginTopNumber
marginRightNumber
marginEndNumber
marginBottomNumber8
marginLeftNumber
marginStartNumber
paddingTopNumber20
paddingRightNumber0
paddingBottomNumber8
paddingLeftNumber0
colorStringblack
activeColorString
fontFamilyString
fontSizeNumber15
fontWeightString or Numbernormal
onFocusFunction
onBlurFunction
onChangeTextFunction
onContentSizeChangeFunction

Underline

NameTypeDefault
underlineDurationNumber200
underlineHeightNumber1
underlineColorStringgray
underlineActiveColorString#3f51b5
underlineActiveHeightNumber2

ErrorHelper

NameTypeDefault
errorString
errorBackgroundColorStringTransparent
errorPaddingTopNumber8
errorColorString#fc1f4a
errorFontSizeNumber12

Icons

NameTypeDefault
leftIconString
leftIconSizeNumber15
leftIconColorString#777777
leftIconTypeStringion
onPressLeftIconFunction
rightIconString
rightIconSizeNumber15
rightIconColorString#777777
rightIconTypeStringion
onPressRightIconFunction
rippleColorStringrgba(220,220,220,10)

Icon Types

NameTypeiconLibrary
ionStringIonIcons
octStringOcticons
evilStringEvilicons
awesomeStringFontAwesome
materialStringMaterialCommunityIcons

Other TextInput properties will also work

## License

The MIT License.

See [LICENSE](LICENSE)