1.0.7 • Published 7 months ago

react-input-customizer v1.0.7

Weekly downloads
-
License
ISC
Repository
github
Last release
7 months ago

React Input Glow Component

The React Input Glow Component provides a flexible and customizable input field with floating labels. It is designed to be easy to use and highly configurable.

Installation

You can install the React Glow Input Component using npm or yarn:

npm install react-input-customizer

or

yarn add react-input-customizer

Usage

To use the React Input Glow Component, you should import the FloatingInputProps interface from 'react' and use it to define the props for your input field. Here's an example of how to use it:

import React from 'react';
import InputBox from 'react-input-customizer';

const MyForm = () => {
  const handleChange = (value) => {
    // Handle input value change
  };

  return (
    <div>
      <h2>Example Form</h2>
      <label>Name:</label>
      <InputBox
        name="name"
        label="Name"
        placeholder="Enter your name"
        onChange={handleChange}
        // Add other props as needed
      />
      {/* Add more input fields */}
    </div>
  );
};

export default MyForm;

In this example, we import the FloatingInputProps interface and use it to define the props for our input field. We can customize various aspects of the input field, such as the label, placeholder, and event handlers.

Feel free to explore the available props in the FloatingInputProps interface and adjust them to fit your specific use case. The React Input Glow Component is highly customizable and can be integrated into your forms with ease.

Storybook Example

You can also explore more examples in the React Input Glow Component Storybook.

Props Table

Here's a table of available props for the FloatingInputProps interface, arranged alphabetically:

PropTypeDescription
borderColorstringThe border color of the input field.
borderRadiusstringThe border radius for the input container.
borderWidthstringThe border width of the input field.
classNamestringAdditional CSS class for the input container.
disabledbooleanWhether the input is disabled.
errorLabelTextColorstringThe text color for the error label.
errorTextstringThe error text to display.
errorTextClassNamestringAdditional CSS class for the error message.
errorTextColorstringThe text color for the error message.
heightstringThe height of the input field.
iconReact.ReactNodeAn icon component to display within the input.
iconPosition'left' | 'right'The position of an icon (if provided).
inputClassNamestringAdditional CSS class for the input field.
isFloatingbooleanWhether the label should float on focus.
labelstringThe label for the input field.
labelBackgroundstringThe background color of the label.
labelClassNamestringAdditional CSS class for the label element.
labelPosition'inline' | 'outside' | 'inside'The position of the label.
labelTextColorstringThe text color of the label.
labelClassNamestringAdditional CSS class for the legend
namestringThe name attribute for the input field.
placeholderstringThe placeholder text for the input field.
primaryColorstringThe primary color of the input field.
showIconbooleanAn icon boolean to display within the input.
requiredbooleanWhether the input is required.
textColorstringThe text color of the input field.
toggleOffIconReact.ReactNodeAn icon to use when the input is toggled off (e.g., for passwords).
toggleOnIconReact.ReactNodeAn icon to use when the input is toggled on (e.g., for passwords).
typestringThe type of the input field (e.g., "text", "password").
widthstringThe width of the input field.