my-reusable-input
v1.0.20
Published
A reusable input component for React with validation, debouncing, and accessibility support.
Maintainers
Readme
my-reusable-input
A reusable, accessible React input component with built-in validation, debouncing, and error handling.
Easily customizable via props for any input type (text, email, tel, password, etc.) — designed for modern React apps.
✨ Features
- ✅ Supports text, email, password, tel, and more.
- ✅ Built-in validation (required, min/max length, email format, tel format).
- ✅ Optional debouncing for delayed validation feedback.
- ✅ Works as controlled or uncontrolled component.
- ✅ Customizable input, label, and wrapper class names.
- ✅ Emits error messages via
onErrorcallback. - ✅ Built-in sanitization for tel inputs (numbers only).
- ✅ Fully accessible: labels, ARIA attributes, and error descriptions.
🧩 Installation
npm install my-reusable-input
# or
yarn add my-reusable-input
## 🧩 Usage Examples
### 1️⃣ Basic Usage
```tsx
import { ReusableInput } from "my-reusable-input";
export default function BasicExample() {
return (
<div className="p-4 space-y-3">
<ReusableInput
type="text"
label="Full Name"
required
minLength={3}
placeholder="Enter your full name"
/>
</div>
);
}