Socket
Socket
Sign inDemoInstall

react-native-input-outline

Package Overview
Dependencies
514
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-native-input-outline

Performant React Native Text Inputs


Version published
Weekly downloads
245
decreased by-39.21%
Maintainers
1
Install size
166 kB
Created
Weekly downloads
 

Readme

Source

React Native Input Outline

A performant TextInput with fully configurable options 🚀

React Native Bottom Sheet

I built this library because of all the performance issues I noticed in other TextInput libraries. This library is extremely performant thanks to Reanimated v2. Leave a star if you enjoy it!

Performant React Native TextInputs built with Reanimated 2.

Installation

yarn add react-native-reanimated@2.0.0-rc.0 react-native-input-outline

Reanimated v2 is required for this library to work.

Usage

import React, { useRef, useState } from 'react';
import { View, Button } from 'react-native';
import { InputOutline, InputStandard } from 'react-native-input-outline';

export default () => {
  const inputRef = useRef < InputOutline > null; // fully TypeScript enabled
  const [error, setError] = (useState < string) | (undefined > undefined);

  const showError = () => {
    setError('This is your error message!');
  };

  const hideError = () => {
    setError(undefined);
  };

  return (
    <View>
      <InputOutline
        ref={inputRef}
        error={error} // wont take effect until a message is passed
      />

      <InputStandard /> 

      <Button onPress={showError} title="Set Input Error" />
    </View>
  );
};

All vanilla ReactNative TextInput Props along with regular ref usage are supported as well as others configured from this library shown below.

Props

PropDesriptionDefaultType
TextInput PropsInherited PropsTextInput Props
activeColorColor when focused.'blue'string
inactiveColorColor when blurred (not focused).'black'string
errorColorColor that is displayed when in error state.'red'string
backgroundColorBackground color of the TextInput.'white'string
fontSizeFont size for TextInput.14number
fontFamilyFont Family for all fonts.undefinedstring
fontColorColor of TextInput's font.blackstring
errorError message is displayed. If anything is provided to error besides null or undefined, then the component is within an error state, thus displaying the error message provided here and errorColor.undefined`string
errorFontSizeFont size of error text.10number
errorFontFamilyFont family of error text.undefinedstring
assistiveTextWill show a character count helper text and limit the characters being entered.undefinedstring
assistiveTextFontSizeFont size of assistive text.10number
assitiveTextFontFamilyFont family of assistive text.undefinedstring
assistiveTextColorFont color of assistive text.inactiveColorstring
characterCountWill show a character count helper text and limit the characters being entered.undefinednumber
characterCountFontSizeFont size of character count text.10number
characterCountFontFamilyFont family of character count text.undefinedstring
characterCountColorFont color of character count text.inactiveColorstring
paddingVerticalVertical padding for TextInput Container. Used to calculate animations.12number
paddingHorizontalHorizontal padding for TextInput Container.16number
roundnessBorder Radius for Container.5number
trailingIconTrailing Icon for the Input.undefinedReact.FC
placeholderThe string that will be rendered before text input has been entered.string

Methods

MethodDescription
focus()Requests focus for the given input or view. The exact behavior triggered will depend on the platform and type of view.
blur()Removes focus from an input or view. This is the opposite of focus()
isFocused()Returns current focus of input.
clear()Removes all text from the TextInput.

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT

Keywords

FAQs

Last updated on 06 Sep 2021

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