1.0.5 โ€ข Published 6 months ago

inputy v1.0.5

Weekly downloads
-
License
MIT
Repository
-
Last release
6 months ago

Inputy - 30+ React/Next Input Component with Smart Formatting

npm version npm downloads License: MIT

๐ŸŽฏ 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"
    />
  );
}

View more examples

๐Ÿ“š Input Types & Validation

๐ŸŒˆ Supported Input Types

Payment & Financial Inputs

TypeDescriptionExample Format
debitCardDebit Card Number1234 5678 9012 3456
creditCardCredit Card Number1234 5678 9012 3456
cvvCard Verification Value123
expiryDateCard Expiry Date12/25
currencyMonetary Values1,234.56
percentagePercentage Values99.9%
accountNumberBank Account Number1234 5678 9012 3456
creditScoreCredit Score750

Identification & Personal Inputs

TypeDescriptionExample Format
panPermanent Account NumberABCDE1234F
aadharIndian Identification Number1234 5678 9012
passportPassport NumberA1234567
voterIdVoter IdentificationABC1234567
drivingLicenseDriver's LicenseDL1234567890123
ssnSocial Security Number123-45-6789
usernameUsernameuser_name123

Contact & Location Inputs

TypeDescriptionExample Format
phonePhone Number1234567890
emailEmail Addressuser@example.com
urlWeb Addresshttps://example.com
ipAddressIP Address192.168.1.1
coordinatesGeographical Coordinates12.9716,77.5946

Specialized Inputs

TypeDescriptionExample Format
vehicleNumberVehicle RegistrationAB 12 CD 3456
gstGoods and Services Tax ID29ABCDE1234F1Z5
ifscIndian Financial System CodeSBIN0125620
upiUnified Payments Interfaceuser@bank
swiftCodeBank Identifier CodeSBININBB123
hexColorHex Color Code#FF5733
isbnInternational Standard Book Number978-0-13-149505-0
vinVehicle Identification Number1HGCM82633A123456
stockSymbolStock Market SymbolAAPL

Date & Time Inputs

TypeDescriptionExample Format
dobDate of Birth25/12/1990
timeTime14:30
durationTime Duration02:30:45
ageAge35

Measurement Inputs

TypeDescriptionExample Format
weightWeight75.5
heightHeight175 cm
temperatureTemperature37.5ยฐC
fileSizeFile Size10.5 MB

Other Inputs

TypeDescriptionExample Format
textStandard Text InputAny text
numericNumeric Input12345
passwordPassword Input****
pincodePin/Postal Code123456

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:

VariantFocus BorderFocus Shadow
Primary#3b82f6Soft blue highlight
Success#22c55eSoft green highlight
Error#ef4444Soft red highlight
Warning#f59e0bSoft orange highlight
Info#0ea5e9Soft 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

  1. Use CSS variables for easy theming
  2. Leverage built-in animation classes
  3. Combine theme and color variants
  4. 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

  1. Open a Pull Request
  2. Describe your changes in detail
  3. Link any related issues
  4. Wait for maintainer review
  5. 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

  1. Be respectful and inclusive
  2. Provide constructive feedback
  3. Collaborate with kindness
  4. Respect diverse perspectives
  5. 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


1.0.5

6 months ago

1.0.4

6 months ago

1.0.3

6 months ago

1.0.2

6 months ago

1.0.1

6 months ago

1.0.0

6 months ago