Socket
Socket
Sign inDemoInstall

reinput-saphi

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    reinput-saphi

A React Native TextInput with material style 😎


Version published
Maintainers
1
Created

Readme

Source

Reinput

npm type definitions js-standard-style semantic-release npm

A React Native TextInput with material style 😎

reinput-gif

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 ;)

Demo

Wanna try before? Here's an interactive Expo snack. Otherwise, you can clone the repo and run the /example folder. It's the same, tho.

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
NameTypeDefault
activeColorString
colorString#000000
fontFamilyString
fontSizeNumber15
fontWeightString or Numbernormal
heightNumber64
marginBottomNumber8
marginLeftNumber
marginRightNumber
marginTopNumber
maxHeightNumber
minHeightNumber
onBlurFunction
onChangeTextFunction
onContentSizeChangeFunction
onFocusFunction
paddingBottomNumber8
paddingLeftNumber0
paddingRightNumber0
paddingTopNumber20
registerFunctionnoop
textAlignStringleft
  • Register exposes the TextInput ref component out
Label
nametypedefault
labelString
labelActiveColorString#3f51b5
labelActiveScaleNumber0.8
labelActiveTopNumber-18
labelColorString#757575
labelDurationNumber200
Icon
NameTypeDefault
iconElement
iconOverlayElement
Placeholder
NameTypeDefault
placeholderString
placeholderColorString#757575
placeholderVisibilitybooleanundefined

How placeholderVisibility works?

{
    Always: 1,
    Never: null,
    OnFocus: true,
    OnBlur: false,
}
Underline
NameTypeDefault
underlineActiveColorString#3f51b5
underlineActiveHeightNumber2
underlineColorString#757575
underlineDurationNumber200
underlineHeightNumber1
Error
NameTypeDefault
errorString
errorColorString#fc1f4a
errorStyleTextStyle
errorStyle.fontSizeNumber12
errorStyle.paddingTopNumber4
errorStyle.paddingBottomNumber4

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 */}
  />
)

Credits

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

Keywords

FAQs

Last updated on 18 Jan 2022

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