inputy v1.0.5
Inputy - 30+ React/Next Input Component with Smart Formatting
๐ฏ A powerful, lightweight React input component with built-in formatters for various input types. Perfect for forms, payment fields, and user data collection. Supports TypeScript, Next.js, and modern React frameworks.
Quick Start โข Examples โข Features โข API Documentation โข Support
Why Choose Inputy?
- ๐ Zero Dependencies - Lightweight and fast
- ๐ช TypeScript Ready - Full type safety and IntelliSense support
- ๐จ Framework Agnostic - Works with Next.js, Create React App, Vite, and more
- ๐ฑ Mobile Friendly - Responsive and touch-optimized
- ๐ Dark Mode Support - Automatic dark theme detection
- โฟ Accessibility First - WCAG compliant with ARIA support
๐ Installation
Choose your preferred package manager:
# Using npm
npm install inputy
# Using yarn
yarn add inputy
# Using pnpm
pnpm add inputy
๐ป Framework Compatibility
Modern React Frameworks
- โ๏ธ React 16.8+ with Hooks
- ๐ฑ Next.js 12, 13, 14 (Pages & App Router)
- โก Vite
- ๐ฏ Create React App (CRA)
- ๐จ Remix
- ๐ Gatsby
- ๐ฅ React + TypeScript Projects
Build System Support
- ๐ฆ Webpack 4/5
- ๐ Rollup
- ๐๏ธ esbuild
- ๐ฏ Parcel 2
CSS Framework Integration
- ๐จ CSS Modules
- ๐ Styled Components
- ๐ฏ Tailwind CSS
- ๐ฅ Emotion
- ๐ SASS/SCSS
๐ Key Features of Inputy
โจ Smart Input Formatting
- ๐ Auto-formatting for 30+ input types
- ๐ณ Credit/Debit card number spacing
- ๐ฑ Intelligent phone number formatting
- ๐ Dynamic date input parsing
- ๐ท๏ธ Specialized ID card formatting
- ๐ Real-time input validation
- ๐งน Automatic input sanitization
๐จ Advanced Styling
- ๐ 7 Built-in theme variants
- ๐ Dark/Light mode support
- ๐๏ธ Fully customizable CSS
- ๐ฒ Multiple color schemes
- ๐ฑ Responsive design
- ๐ Smooth animations
- ๐ง Flexible sizing options
๐ก๏ธ Input Type Mastery
- ๐ผ Financial inputs
- ๐ Identification documents
- ๐ Communication fields
- ๐ International format support
- ๐ข Numeric and text variants
- ๐ Strict input constraints
- ๐ซ Error prevention
๐ป Developer Experience
- ๐ท TypeScript first
- ๐ Zero dependencies
- ๐ค Form library compatibility
- ๐ Easy integration
- ๐ฆ Lightweight implementation
- ๐งช Comprehensive type definitions
- ๐ IntelliSense support
โฟ Accessibility Excellence
- ๐ WCAG 2.1 compliant
- โฟ Screen reader friendly
- โจ๏ธ Full keyboard navigation
- ๐จ High contrast support
- ๐ข ARIA attribute integration
- ๐ Color-blind considerations
- ๐ Semantic HTML structure
๐ Advanced Features
- ๐ Debounced value changes
- ๐ญ State-based animations
- ๐ Internationalization ready
- ๐ Client-side rendering
- ๐ Performance optimized
- ๐ ๏ธ Extensive customization
- ๐ง Predictive input handling
๐ป Quick Start Examples
Basic React Input
import { Inputy } from "inputy";
import "inputy/dist/styles.css";
function App() {
return (
<Inputy
type="phone"
label="Phone Number"
required
onValueChange={(value) => console.log(value)}
/>
);
}
Next.js Integration
// pages/_app.js or app/layout.js
import "inputy/dist/styles.css";
// Your component
import { Inputy } from "inputy";
export default function PaymentForm() {
return (
<Inputy
type="debitCard"
label="Card Number"
required
errorMessage="Invalid card number"
/>
);
}
๐ Input Types & Validation
๐ Supported Input Types
Payment & Financial Inputs
Type | Description | Example Format |
---|---|---|
debitCard | Debit Card Number | 1234 5678 9012 3456 |
creditCard | Credit Card Number | 1234 5678 9012 3456 |
cvv | Card Verification Value | 123 |
expiryDate | Card Expiry Date | 12/25 |
currency | Monetary Values | 1,234.56 |
percentage | Percentage Values | 99.9% |
accountNumber | Bank Account Number | 1234 5678 9012 3456 |
creditScore | Credit Score | 750 |
Identification & Personal Inputs
Type | Description | Example Format |
---|---|---|
pan | Permanent Account Number | ABCDE1234F |
aadhar | Indian Identification Number | 1234 5678 9012 |
passport | Passport Number | A1234567 |
voterId | Voter Identification | ABC1234567 |
drivingLicense | Driver's License | DL1234567890123 |
ssn | Social Security Number | 123-45-6789 |
username | Username | user_name123 |
Contact & Location Inputs
Type | Description | Example Format |
---|---|---|
phone | Phone Number | 1234567890 |
email | Email Address | user@example.com |
url | Web Address | https://example.com |
ipAddress | IP Address | 192.168.1.1 |
coordinates | Geographical Coordinates | 12.9716,77.5946 |
Specialized Inputs
Type | Description | Example Format |
---|---|---|
vehicleNumber | Vehicle Registration | AB 12 CD 3456 |
gst | Goods and Services Tax ID | 29ABCDE1234F1Z5 |
ifsc | Indian Financial System Code | SBIN0125620 |
upi | Unified Payments Interface | user@bank |
swiftCode | Bank Identifier Code | SBININBB123 |
hexColor | Hex Color Code | #FF5733 |
isbn | International Standard Book Number | 978-0-13-149505-0 |
vin | Vehicle Identification Number | 1HGCM82633A123456 |
stockSymbol | Stock Market Symbol | AAPL |
Date & Time Inputs
Type | Description | Example Format |
---|---|---|
dob | Date of Birth | 25/12/1990 |
time | Time | 14:30 |
duration | Time Duration | 02:30:45 |
age | Age | 35 |
Measurement Inputs
Type | Description | Example Format |
---|---|---|
weight | Weight | 75.5 |
height | Height | 175 cm |
temperature | Temperature | 37.5ยฐC |
fileSize | File Size | 10.5 MB |
Other Inputs
Type | Description | Example Format |
---|---|---|
text | Standard Text Input | Any text |
numeric | Numeric Input | 12345 |
password | Password Input | **** |
pincode | Pin/Postal Code | 123456 |
Inputy Styling Guide ๐จ
๐ Theme Variants
Inputy offers multiple sophisticated theme options to suit any design aesthetic:
1. Classic Theme
.inputy-theme-classic {
background: #ffffff;
border: 1px solid #bfdbfe;
border-radius: 4px;
}
- Minimalist and clean
- Soft border with light primary color
- Subtle transitions
2. Modern Theme
.inputy-theme-modern {
background: #f8fafc;
border: 2px solid #93c5fd;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}
- Contemporary design
- Slightly elevated appearance
- Soft shadow effect
3. Glass Theme
.inputy-theme-glass {
background: rgba(255, 255, 255, 0.1);
backdrop-filter: blur(10px);
border: 1px solid rgba(255, 255, 255, 0.2);
border-radius: 12px;
}
- Translucent, modern look
- Blur effect
- Perfect for modern UI designs
4. Minimal Theme
.inputy-theme-minimal {
background: transparent;
border: none;
border-bottom: 2px solid #bfdbfe;
}
- Stripped-down design
- Underline focus
- Clean and elegant
5. Neumorphic Theme
.inputy-theme-neumorphic {
background: #e0e5ec;
border-radius: 15px;
box-shadow:
8px 8px 15px rgba(163, 177, 198, 0.6),
-8px -8px 15px rgba(255, 255, 255, 0.8);
}
- Soft, raised design
- Simulated depth
- Modern skeuomorphic approach
6. Neon Theme
.inputy-theme-neon {
background: #1a1a1a;
border: 2px solid #60a5fa;
color: #ffffff;
box-shadow: 0 0 10px #60a5fa;
}
- High-contrast design
- Glowing border effect
- Futuristic appearance
7. Retro Theme
.inputy-theme-retro {
background: #fdf6e3;
border: 3px solid #000000;
box-shadow: 3px 3px 0 #000000;
}
- Vintage-inspired design
- Bold borders
- Nostalgic feel
๐จ Color Variants
Inputy supports multiple color schemes for different states:
Variant | Focus Border | Focus Shadow |
---|---|---|
Primary | #3b82f6 | Soft blue highlight |
Success | #22c55e | Soft green highlight |
Error | #ef4444 | Soft red highlight |
Warning | #f59e0b | Soft orange highlight |
Info | #0ea5e9 | Soft cyan highlight |
๐ Size Variants
.inputy-size-sm {
padding: 0.4rem 0.6rem;
font-size: 0.875rem;
}
.inputy-size-md {
padding: 0.6rem 0.8rem;
font-size: 1rem;
}
.inputy-size-lg {
padding: 0.8rem 1rem;
font-size: 1.125rem;
}
๐ฌ Animations
State Animations
- Fade In
- Slide Down
- Bounce
- Shake (for errors)
- Pulse
Interaction Animations
- Hover: Slight upward translation
- Focus: Subtle elevation
- Error: Shake animation
- Success: Pulse effect
๐ Dark Mode Support
Inputy automatically adjusts colors in dark mode:
- Background shifts to darker tones
- Border colors become softer
- Maintains readability and contrast
๐ก Customization Tips
- Use CSS variables for easy theming
- Leverage built-in animation classes
- Combine theme and color variants
- Respect dark mode preferences
Example Custom Theme
.my-custom-theme {
--inputy-theme-classic-bg: custom-background-color;
--inputy-theme-classic-border: custom-border-color;
}
๐ง Advanced Styling
- Fully CSS variable driven
- Zero-config theming
- Highly extensible
- Performance-optimized animations
๐งช Testing Support
Compatible with popular testing frameworks:
- โ Jest
- ๐งช React Testing Library
- ๐ฏ Cypress
- โก Vitest
๐ง Browser Support
- โ Chrome (Latest)
- โ Firefox (Latest)
- โ Safari (Latest)
- โ Edge (Latest)
- โ Mobile Browsers
๐ค Contributing to Inputy
Welcome, Developers! ๐
Inputy is an open-source project that thrives on community contributions. Whether you're a seasoned developer or a first-time contributor, there's a way for you to help make Inputy even better.
๐ Why Contribute?
- ๐ก Shape the future of form input components
- ๐ Improve your coding skills
- ๐ค Learn advanced React development
- ๐ Join a global community of developers
- ๐ Build your open-source portfolio
๐ How to Contribute
1. Ways to Contribute
๐ Bug Reports
- Identify and report issues
- Provide detailed reproduction steps
- Help improve component stability
โจ Feature Suggestions
- Propose new input types
- Suggest UI/UX improvements
- Recommend performance optimizations
๐ง Code Contributions
- Fix existing issues
- Implement new features
- Improve documentation
- Enhance test coverage
๐ Documentation
- Improve README
- Create usage examples
- Clarify existing documentation
2. Contribution Workflow
Setting Up
# Fork the repository
# Clone your forked repository
git clone https://github.com/nk-alam/Inputy.git
# Navigate to project directory
cd Inputy
# Install dependencies
npm install
# Create a new branch
git checkout -b feature/your-amazing-contribution
Development Guidelines
- Follow existing code style
- Write clean, readable code
- Add tests for new features
- Ensure all tests pass
- Update documentation
Submission Process
# Stage your changes
git add .
# Commit with a clear message
git commit -m "feat: Add comprehensive phone number input formatting"
# Push to your fork
git push origin feature/your-amazing-contribution
3. Contribution Criteria
Code Quality Checklist
- โ Follows TypeScript best practices
- โ Passes all existing tests
- โ Maintains current performance standards
- โ Adds appropriate type definitions
- โ Includes comprehensive comments
Review Process
- Open a Pull Request
- Describe your changes in detail
- Link any related issues
- Wait for maintainer review
- Address feedback promptly
๐ Contribution Levels
๐ฅ Bronze Contributor
- Opened first issue
- Submitted first PR
- Provided valuable feedback
๐ฅ Silver Contributor
- Multiple accepted PRs
- Consistent issue reporting
- Active in discussions
๐ฅ Gold Contributor
- Significant codebase improvements
- Regular, high-quality contributions
- Helps maintain and guide the project
๐ Code of Conduct
- Be respectful and inclusive
- Provide constructive feedback
- Collaborate with kindness
- Respect diverse perspectives
- Focus on continuous improvement
๐ก Best Practices
Communication
- Ask questions before major changes
- Discuss complex implementations
- Be open to suggestions
Technical
- Run linters before submitting
- Write meaningful commit messages
- Keep PRs focused and atomic
๐จ What to Avoid
- โ Massive, unfocused PRs
- โ Code without tests
- โ Ignoring existing design patterns
- โ Rude or dismissive communication
๐ Special Thanks
Every contribution matters! Whether it's a tiny typo fix or a major feature, your effort helps improve Inputy for developers worldwide.
Happy Coding! ๐๐ฉโ๐ป๐จโ๐ป
๐ License
MIT ยฉ Nk Alam