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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@ronas-it/react-native-controlled-input

v0.1.0

Published

React Native controlled TextInput with strict value sync (Fabric)

Readme

@ronas-it/react-native-controlled-input

A controlled React Native input that lets you format and constrain the value exactly how you want in JS, while keeping the displayed text in sync without invalid characters flashing in the field.

ControlledInputView (left) vs React Native TextInput (right), same JS formatting: with TextInput, rejected characters and intermediate states often flash until the filtered value is applied.

Promo / invite code (ABCD-1234)

| ControlledInputView | TextInput | | :-----------------: | :-------: | | | |

Card expiry (MM/YY)

| ControlledInputView | TextInput | | :-----------------: | :-------: | | | |

Problem

With a regular controlled TextInput, native input is applied first, then JS receives the change, filters it, and sends the next value back.

That means invalid characters can still flash in the field for a moment.

@ronas-it/react-native-controlled-input is built for this exact case: you decide what text is valid, and the displayed value stays driven by value.

Install

npm install @ronas-it/react-native-controlled-input

Requires React Native New Architecture / Fabric.

Compatible with react-native-keyboard-controller.

Example

import { useRef, useState } from 'react';
import { StyleSheet } from 'react-native';
import {
  ControlledInputView,
  type ControlledInputViewRef,
} from '@ronas-it/react-native-controlled-input';

export function Example() {
  const [value, setValue] = useState('');
  const inputRef = useRef<ControlledInputViewRef>(null);

  return (
    <ControlledInputView
      ref={inputRef}
      value={value}
      onChangeText={(text) => setValue(text.replace(/\d/g, ''))}
      style={styles.input}
      onFocus={() => {}}
      onBlur={() => {}}
    />
  );
}

const styles = StyleSheet.create({
  input: {
    height: 48,
    borderWidth: 1,
    borderColor: '#ccc',
    borderRadius: 8,
    paddingHorizontal: 12,
    fontSize: 16,
    color: '#111',
  },
});
inputRef.current?.focus();
inputRef.current?.blur();

Props

| Prop | Type | Description | |------|------|-------------| | value | string | Current input value. | | onChangeText | (value: string) => void | Called with the next text value. Filter it and update value. | | onFocus | () => void | Called when the text input is focused. | | onBlur | () => void | Called when the text input is blurred. | | onSubmitEditing | () => void | Called when the text input is blurred. | | autoComplete | string | Specifies autocomplete hints for the system. Same as React Native TextInput. | | autoCapitalize | string | Can be none, sentences, words, characters. Same as React Native TextInput. | | autoCorrect | boolean (default true) | Toggles auto-correct. Same as React Native TextInput. | | keyboardType | string | Determines which keyboard to open, e.g. numeric. Same as React Native TextInput. | | returnKeyType | string | Determines how the return key should look. Same as React Native TextInput. | | placeholder | string | The string that will be rendered before text input has been entered. | | placeholderTextColor | ColorValue | The text color of the placeholder string. | | selectionColor | ColorValue | The highlight and cursor color of the text input. |

Style support

The same style API is supported on both iOS and Android.

Commonly used supported styles:

  • color, fontSize, fontFamily
  • padding, paddingVertical, paddingHorizontal
  • paddingTop, paddingBottom, paddingLeft, paddingRight, paddingStart, paddingEnd
  • borderWidth, borderRadius, borderColor, backgroundColor
  • layout styles like width, height, margin, flex

Implementation differs internally between platforms, but usage is the same for library consumers.

Fonts

In Expo projects, fontFamily on this input only applies when the font is linked for native use. Relying on runtime loading alone (useFonts / loadAsync) is often not enough here; use the expo-font config plugin so fonts are embedded at build time. See Expo Font — Configuration in app config.

Ref

  • focus()
  • blur()

License

MIT


Made with create-react-native-library