1.27.5 • Published 4 months ago

bik-inputs v1.27.5

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

bik-inputs

A reusable, customizable, and accessible input component library for React applications. Supports multiple input types with various customizations.

📦 Installation

npm install bik-inputs

or

yarn add bik-inputs

Dependencies

clsx Tailwind CSS input-otp react-datepicker dayjs

📌 Note:

This library utilizes Tailwind CSS for styling. The colors displayed in the input fields can be customized by modifying the primary and secondary colors in your Tailwind configuration file. To ensure proper styling, make sure to define primary and secondary-700 in your Tailwind theme settings.

🚀 Usage

Basic Example

import React from "react";
import { AnimatedInputField } from "bik-inputs";

const App = () => {
  const [formData, setFormData] = useState<Record<string, string>>({});
  const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
    const { name, value } = e.target;
    setFormData((prev) => ({ ...prev, [name]: value }));
  };
  return (
    <AnimatedInputField
      label="Username"
      name="username"
      formData={formData}
      onChange={handleChange}
    />
  );
};

export default App;

🎨 Available Input Fields

<PhoneInputField placeholder="Enter your phone number" />
<AnimatedInputField placeholder="Animated Input" />
<CalculationInputField placeholder="Calculation Input" />
<EmailInputField placeholder="Enter your email" />
<AnimatedTextArea placeholder="Animated Text Area" />
<ValidationInputField placeholder="Validation Input" />
<UserSearchField placeholder="Search User" />
<OTPInputField value="" handleOnChange={handleOnChange} />
<DateInputField />

📋 Props & Customization

Each component has its own set of props for customization. Check the documentation for details on each input field's specific properties.

Common Props

PropTypeDefaultDescriptionRequired
labelstring""Label for the input field✅ Yes
typestring"text"Input type❌ No
namestring""Input name✅ Yes
formDataRecord<string, string>{}Form data storage✅ Yes
onChange(e: any) => voidundefinedChange event handler✅ Yes
onBlur() => voidundefinedBlur event handler❌ No
classNamestring""Additional CSS classes❌ No
disabledbooleanfalseDisables the input field❌ No
requiredbooleanfalseMarks the field as required❌ No
readOnlybooleanfalseSets the field as read-only❌ No

🛠 Customization & Styling

You can override styles using the className prop.

<AnimatedInputField className="custom-input" />

🔗 More Details

For more details, visit the GitHub repository.

🔗 Development

How to Contribute


🔗 License

This project is licensed under the MIT License.


👨‍💻 Author

Created by bikiran.com. Feel free to contribute!

1.27.2

5 months ago

1.27.3

4 months ago

1.27.4

4 months ago

1.27.5

4 months ago

1.27.1

5 months ago

1.25.0

5 months ago

1.23.2

5 months ago

1.25.1

5 months ago

1.23.3

5 months ago

1.25.4

5 months ago

1.23.6

5 months ago

1.25.5

5 months ago

1.23.7

5 months ago

1.27.0

5 months ago

1.25.2

5 months ago

1.23.4

5 months ago

1.25.3

5 months ago

1.23.5

5 months ago

1.25.8

5 months ago

1.25.9

5 months ago

1.25.6

5 months ago

1.23.8

5 months ago

1.25.7

5 months ago

1.23.9

5 months ago

1.24.1

5 months ago

1.26.0

5 months ago

1.24.2

5 months ago

1.24.0

5 months ago

1.26.3

5 months ago

1.24.5

5 months ago

1.26.4

5 months ago

1.24.6

5 months ago

1.26.1

5 months ago

1.24.3

5 months ago

1.26.2

5 months ago

1.24.4

5 months ago

1.26.7

5 months ago

1.24.9

5 months ago

1.26.8

5 months ago

1.26.5

5 months ago

1.24.7

5 months ago

1.26.6

5 months ago

1.24.8

5 months ago

1.26.9

5 months ago

1.22.0

5 months ago

1.23.0

5 months ago

1.23.1

5 months ago

1.15.0

5 months ago

1.2.0

6 months ago

1.14.0

5 months ago

1.13.0

5 months ago

1.12.0

5 months ago

1.19.0

5 months ago

1.18.0

5 months ago

1.17.0

5 months ago

1.16.0

5 months ago

1.9.0

5 months ago

1.8.0

5 months ago

1.7.0

6 months ago

1.6.0

6 months ago

1.5.0

6 months ago

1.4.0

6 months ago

1.3.0

6 months ago

1.21.0

5 months ago

1.11.0

5 months ago

1.10.0

5 months ago

1.20.0

5 months ago

1.0.0

6 months ago