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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@react-native-utils/forminput

v2.0.2

Published

A comprehensive React Native form input component with date selection, validation, and customizable styling.

Downloads

54

Readme

FormInput Component

The FormInput is a custom, reusable input component for React-Native applications. It supports both text input and date picker functionality, with extensive customization options.

▶️ View Live on Expo Snack ▶️ | Full Documentation

Table of Contents

Installation

npm install @react-native-utils/forminput
# or
yarn add @react-native-utils/forminput

Basic Usage

import { useState } from "react";
import { FormInput } from "@react-native-utils/forminput";

const App = () => {
  const [name, setName] = useState<string>("");

  // New grouped props approach (v2.0+)
  return (
    <FormInput
      text={{
        labelText: "Name",
        placeholderText: "Enter your name",
        value: name,
        characterLimit: 20,
      }}
      style={{
        isRequired: true,
      }}
      icon={{
        leftIcon: "user",
        rightIcon: "times-circle",
        rightIconColor: name ? "#999" : "#CCC",
        rightIconOnPress: () => setName("")
      }}
      core={{
        onTextChange: (text) => setName(text)
      }}
    />
  );
};

Prop Groups

FormInput v2.0+ uses a modern grouped props approach for better organization and TypeScript support:

| Prop Group | Description | Example | |------------|-------------|---------| | text | Text content props like label, placeholder, and values | text={{ labelText: "Name" }} | | style | Visual styling props | style={{ inputContainerStyle: { borderRadius: 8 } }} | | icon | Left and right icon configuration | icon={{ leftIcon: "user" }} | | core | Core functionality props | core={{ onTextChange: (text) => setValue(text) }} | | datePicker | Date picker functionality | datePicker={{ enabled: true }} | | datePickerStyle | Date picker styling | datePickerStyle={{ selectedTextStyle: { color: "blue" } }} | | componentProps | Props passed to underlying components | componentProps={{ textInputProps: { autoFocus: true } }} |

For detailed documentation of all available props within each group, refer to:

Migration Guide (v2)

Breaking Changes

Version 2.0 introduces a new props structure that groups related props together. While the flat props structure is still supported for backward compatibility, we recommend migrating to the new grouped approach:

Before (v1.x):

<FormInput 
  labelText="Name"
  value={name}
  onTextChange={(text) => setName(text)}
  leftIcon="user"
/>

After (v2.x):

<FormInput 
  text={{
    labelText: "Name",
    value: name
  }}
  core={{
    onTextChange: (text) => setName(text)
  }}
  icon={{
    leftIcon: "user"
  }}
/>

Examples

Basic Text Input

<FormInput
  text={{ labelText: "Email", placeholderText: "Enter your email" }}
  style={{ isRequired: true }}
  core={{ inputType: "email-address" }}
/>

Date Picker

<FormInput
  text={{ labelText: "Date of Birth", datePlaceholder: "Select Date" }}
  datePicker={{ 
    enabled: true,
    disableFutureDates: true,
    onDateChange: (date) => setSelectedDate(date)
  }}
  icon={{ leftIcon: "calendar" }}
/>

Password Input

<FormInput
  text={{ labelText: "Password", placeholderText: "Enter password" }}
  core={{ hiddenText: true }}
  icon={{ rightIcon: "eye", rightIconOnPress: () => togglePasswordVisibility() }}
/>

For complete documentation with all available props and advanced examples, please visit our documentation website.

Component Previews

Text Input Previews

Date Picker Previews

Changelog

For a complete version history, see our full changelog on the documentation website.

[2.0.2] - 2025-06-28

  • Minor Bug Fixes.

[2.0.1] - 2025-06-28

  • Minor Bug Fixes.

[2.0.0] - 2025-06-28

  • BREAKING CHANGE: Introduced new grouped props structure for better organization and TypeScript support
  • Added comprehensive JSDoc documentation to all prop types
  • Maintained backward compatibility with flat props structure
  • Improved TypeScript type definitions and intellisense support

[1.9.3] - 2025-05-01

  • Added datePickerConfirmButtonStyle and datePickerConfirmButtonTextStyle props to allow users to customize the confirm button's style and text style in the date picker.

[1.9.2] - 2025-05-01

  • Added datePlaceholderStyle prop to allow users to pass additional styles for the date placeholder text.
  • Fixed minor styling issues in the date picker component.

Documentation

This README provides a quick overview of the FormInput component. For comprehensive documentation including:

  • Complete API reference for all props
  • Advanced usage examples
  • Styling guide
  • Theming instructions
  • Form validation techniques
  • Interactive demos

Please visit our documentation website.