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

reinput

v3.7.2

Published

A React Native TextInput with material style 😎

Downloads

248

Readme

Reinput

devDependency Status js-standard-style semantic-release npm

A React Native TextInput with material style 😎

Installation

npm install --save reinput

yarn add reinput

Motivation

Styling react-native inputs can be cumbersome. And most of them heavily relies onto the material design patterns. This style layer over the regular TextInput paves the way towards and easier and faster development.

We also expose a ReinputButton. Check the docs ;)

Usage

import Reinput from 'reinput'

const Input = () => (
  <View>
    <Reinput label='name' />
    <Reinput error='Handles error' />
    <Reinput label='name' value='control value from outside' />
    <Reinput label='name' defaultValue='initial value' />
    <Reinput label='name' onChangeText={/* any TextInput prop */} />
  </View>
)

Props

Input

Name | Type | Default :-------------------- |:------------------ |:---------- activeColor | String | color | String | #000000 fontFamily | String | fontSize | Number | 15 fontWeight | String or Number | normal height | Number | 64 marginBottom | Number | 8 marginLeft | Number | marginRight | Number | marginTop | Number | maxHeight | Number | minHeight | Number | onBlur | Function | onChangeText | Function | onContentSizeChange | Function | onFocus | Function | paddingBottom | Number | 8 paddingLeft | Number | 0 paddingRight | Number | 0 paddingTop | Number | 20 register | Function | noop textAlign | String | left

  • Register exposes the TextInput ref component out

Label

name | type | default :-------------------- |:------------------ |:------------------ label | String | labelActiveColor | String | #3f51b5 labelActiveScale | Number | 0.8 labelActiveTop | Number | -18 labelColor | String | #757575 labelDuration | Number | 200

Icon

Name | Type | Default :-------------------- |:------------------ |:---------- icon | Element | iconOverlay | Element |

Placeholder

Name | Type | Default :-------------------- |:----------------------- |:---------- placeholder | String | placeholderColor | String | #757575 placeholderVisibility | boolean|undefined|null |

How placeholderVisibility works?

{
    Always: 1,
    Never: null,
    OnFocus: true,
    OnBlur: false,
}

Underline

Name | Type | Default :-------------------- |:------------------ |:---------- underlineActiveColor | String | #3f51b5 underlineActiveHeight | Number | 2 underlineColor | String | #757575 underlineDuration | Number | 200 underlineHeight | Number | 1

Error

Name | Type | Default :-------------------- |:------------------ |:---------- error | String | errorColor | String | #fc1f4a errorStyle | TextStyle | errorStyle.fontSize | Number | 12 errorStyle.paddingTop | Number | 4 errorStyle.paddingBottom| Number | 4

And also all the TextInput properties will work.

ReinputButton

We also expose a component that looks like an Input but it's a button so accepts onPress prop. We do following the material design guidelines.

Props are the same as the Input but it also accepts an onPress and doesn't have hooks for focus/blur events.

import { ReinputButton } from 'reinput'

const Input = () => (
  <ReinputButton
    label='This is not an Input'
    value='If there is no value it shows the label as placeholder'
    onPress={/* whatever callback */}
  />
)

Example

I'm working on an expo demo. So far, you can clone the project and check the example dir. It's the one of the gif ;)

Credits

Style patterns are mainly based on Material Design; properly adapted for iOS.