jattac.libs.web.text-form-field
v0.0.4
Published
The TextFormField component is a versatile and customizable React input field component designed for handling various types of text input scenarios. It is implemented in TypeScript and provides additional features beyond a basic input field.
Downloads
3
Readme
TextFormField Component
The TextFormField
component is a versatile and customizable React input field component designed for handling various types of text input scenarios. It is implemented in TypeScript and provides additional features beyond a basic input field.
Installation
Install the TextFormField
component in your project using npm:
npm install --save jattac.libs.web.text-form-field
Usage
Integrate the TextFormField
component into your React application with ease. Below is a basic example demonstrating its usage:
import TextFormField, { TextFieldTypes } from 'jattac.libs.web.text-form-field';
// Example of incorporating the TextFormField component in your form
const MyForm = () => {
const handleInputChange = (value: string) => {
// Handle input change logic
};
return (
<TextFormField
type={"email"}
value=""
onChange={handleInputChange}
maxLength={50}
/>
);
};
Props
type (required)
Specifies the type of the input field. Choose from the following options:
- 'text': Standard text input.
- 'email': Email input type.
- 'password': Password input type.
- 'number': Numeric input type.
- 'url': URL input type.
value (required)
The current value of the input field.
onChange (required)
A callback function triggered when the input value changes.
maxLength
An optional prop to set the maximum length of the input field.