0.22.1 • Published 1 month ago

@bolttech/atoms-input v0.22.1

Weekly downloads
-
License
-
Repository
-
Last release
1 month ago

Input Component

A customizable input component with optional icon, label, and error message support.

Installation

Use the package manager npm or yarn to install the component and its dependencies.

npm install @bolttech/frontend-foundations @bolttech/atoms-input

or

yarn add @bolttech/frontend-foundations @bolttech/atoms-input

Props

The Input component accepts the following properties:

PropTypeDescription
idstringThe id attribute of the input component.
dataTestIdstringThe data-testid attribute for testing.
variantInputVariantsThe variant of the input component (default is 'grey').
errorMessagestringAn error message to be displayed.
iconstringAn icon to be displayed on the right side of the input.
labelstringA label to describe the input.
requiredbooleanWhether the input is required or not.
onClickIconfunctionA function to be called when the icon is clicked.
disabledbooleanWhether the input is disabled or not.
valuestringThe value of the input.
onBlur(value: unknown) => void or (...)Event handler when the input loses focus.
onFocus(value: unknown) => void or (...)Event handler when the input gains focus.
onChange(value: unknown) => void or (...)Event handler when the input value changes.
helperMessagestringAn optional string to display as a helper message for the input.
...propsobjectAdditional props that can be passed to the HTML input element.

Usage

import React from 'react';
import {Input} from '@bolttech/atoms-input';
import {bolttechTheme, BolttechThemeProvider} from "@bolttech/frontend-foundations";

const ExampleComponent = () => {
  const handleClickIcon = () => {
    console.log('Icon Clicked');
  };

  return (
    <BolttechThemeProvider theme={bolttechTheme}>
      <Input
        id="input-id"
        dataTestId="custom-input"
        variant="grey"
        errorMessage="Invalid input"
        icon="search"
        label="Search"
        required
        onClickIcon={handleClickIcon}
        disabled={false}
        value="Sample text"
      />
    </BolttechThemeProvider>
  );
};

export default ExampleComponent;

Contributing

Contributions are welcome! For any bug fixes, improvements, or new features, please open an issue or submit a pull request.

Please make sure to follow the code standards and test your changes before submitting.

0.22.1

1 month ago

0.22.0

1 month ago

0.21.3

2 months ago

0.21.2

3 months ago

0.21.1

4 months ago

0.21.0

6 months ago

0.20.1

6 months ago

0.20.0

6 months ago

0.19.0

7 months ago

0.18.1

7 months ago

0.11.0

9 months ago

0.12.0

9 months ago

0.14.0

9 months ago

0.15.0

9 months ago

0.16.0

9 months ago

0.17.0

9 months ago

0.18.0

8 months ago

0.17.1

8 months ago

0.10.0

10 months ago

0.21.0-0

6 months ago

0.8.0

10 months ago

0.5.0

10 months ago

0.7.0

10 months ago

0.20.2-0

6 months ago

0.6.0

10 months ago

0.0.1

11 months ago

0.4.1

11 months ago

0.4.0

11 months ago

0.2.12

11 months ago

0.2.11

12 months ago

0.3.0

11 months ago

0.3.2

11 months ago

0.3.1

11 months ago

0.2.10

1 year ago

0.2.1

1 year ago

0.2.0

1 year ago

0.2.7

1 year ago

0.2.6

1 year ago

0.2.9

1 year ago

0.2.8

1 year ago

0.2.3

1 year ago

0.2.2

1 year ago

0.2.4

1 year ago

0.1.6

1 year ago

0.1.5

1 year ago

0.1.4

1 year ago

0.1.3

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago