Socket
Socket
Sign inDemoInstall

react-native-materialui-textfield

Package Overview
Dependencies
1
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-native-materialui-textfield

Material textfield


Version published
Weekly downloads
11
decreased by-45%
Maintainers
1
Install size
443 kB
Created
Weekly downloads
 

Readme

Source

react-native-materialui-textfield

This work is heavily based on the fantastic work n4kz has done. That project seems to have been unmaintained, so this one has spawned.

npm license travis codeclimate

Material texfield with consistent behaviour on iOS and Android

example

Features

  • Material design guidelines compliance
  • Consistent look and feel on iOS and Android
  • Animated state transitions (normal, focused and errored)
  • Customizable font size, colors and animation duration
  • Disabled state (with dotted underline)
  • Multiline text input
  • Character counter
  • Prefix and suffix
  • Accessory view
  • Helper text
  • RTL support
  • Pure javascript implementation

Installation

npm install --save react-native-materialui-textfield

Usage

import React, { Component } from 'react';
import { TextField } from 'react-native-materialui-textfield';

class Example extends Component {
  state = {
    phone: '',
  };

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

    return (
      <TextField
        label='Phone number'
        value={phone}
        onChangeText={ (phone) => this.setState({ phone }) }
      />
    );
  }
}

Properties

namedescriptiontypedefault
textColorText input colorStringrgba(0, 0, 0, .87)
fontSizeText input font sizeNumber16
titleFontSizeText field title and error fontSizeNumber12
labelFontSizeText field label font sizeNumber12
labelHeightText field label base heightNumber32
labelPaddingText field label base paddingNumber4
inputContainerPaddingText field input container base paddingNumber8
lineWidthText field underline widthNumber0.5
activeLineWidthText field active underline widthNumber2
disabledLineWidthText field disabled underline widthNumber1
tintColorText field accent colorStringrgb(0, 145, 234)
baseColorText field base colorStringrgba(0, 0, 0, .38)
labelText field label textString-
titleText field helper textString-
prefixText field prefix textString-
suffixText field suffix textString-
errorText field error textString-
errorColorText field color for errored stateStringrgb(213, 0, 0)
disabledLineTypeText field line type in disabled stateStringdotted
animationDurationText field animation duration in msNumber225
characterRestrictionText field soft limit for character counterNumber-
disabledText field availabilityBooleanfalse
editableText field text can be editedBooleantrue
multilineText filed multiline inputBooleanfalse
inputContainerStyleStyle for input container viewObject-
containerStyleStyle for container viewObject-
labelTextStyleStyle for label inner Text componentObject-
titleTextStyleStyle for title inner Text componentObject-
affixTextStyleStyle for affix inner Text componentObject-
renderAccessoryRender input accessory viewFunction-
onChangeTextChange text callbackFunction-
onFocusFocus callbackFunction-
onBlurBlur callbackFunction-
helpersNumberOfLinesError and Title number of linesFunction1

Other TextInput properties will also work

Methods

namedescriptionreturns
focus()Acquire focus-
blur()Release focus-
clear()Clear text field-
value()Get current valueString
isFocused()Get current focus stateBoolean
isRestricted()Get current restriction stateBoolean

Example

git clone https://github.com/petrogad/react-native-materialui-textfield
cd react-native-materialui-textfield/example
npm install
npm run ios # or npm run android

BSD License

Copyright 2018 Alexander Nazarov. All rights reserved.

Keywords

FAQs

Last updated on 14 Sep 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc