npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-custom-input

v2.0.0

Published

react-native-custom-textInput,一个自定义的输入组件

Downloads

4

Readme

react-native-custom-textInput

react-native-custom-input,一个自定义的输入组件
The final rendering

The final rendering

Installation:

 npm install --save react-native-custom-input

Example usage:

1.basic

import Input from react-native-custom-input;

   ...
  render() {
    return (
        <Input />
    );
  }

Props:

|Props|Explain|type|require|default|
|:-------|:--------|:--------|:-------|:----------| |label|输入框的名称|string|no|文本输入框|
|value|输入框的值|any|yes|''|
|labelTextStyle|输入框的名称的样式|string|no|{ width: 100,flexDirection: 'row',justifyContent: 'flex-end', alignItems: 'center',marginLeft: 15,}|
|required|是否显示必输标志|boolean|no|false|
|mode|输入框的模式,具体有简单输入框还是输入域|string|no|简单文本输入框,值为('Input','TextArea')两者之一|
|textInputStyle|输入框的样式|object|no|{fontSize: 14, color: '#332f2b'}|
|isUpdate|是否可编辑,true为可编辑|boolean|no|true|
|suffix|输入框后面的后缀,值得注意的是length大于3的时候将不会显示|string|no|''| |placeholderTextColor|占位符文字的颜色|string|no|'#ccc8c4'|
|autoCapitalize|首字母是否自动大写|string|no|'none',只能是['characters', 'words', 'sentences', 'none']之一|

注意: 由于输入框组件是在react-native官方组件的基础上进行封装,所以支持TextInput所有属性,在这里就不一一罗列

Examples from props:

...
  _onChange = (label, value) => {
    this.setState({ [label]: value });
  };

  render() {
    return (
      <View style={styles.container}>
        <Text>
          {this.state.result}
        </Text>
        <Input onChange={(value) => this._onChange('input1', value)} value={this.state.input1 || ''} />
        <Input label={'姓名'} onChange={(value) => this._onChange('input2', value)} value={this.state.input2 || ''} />
        <Input onChange={(value) => this._onChange('input3', value)} mode={'TextArea'} label={'详细地址'} value={this.state.input3 || ''} />
      </View>
    );
  }
...

LICENSE:

MIT