# @hawk-ui/input

> hawk-ui: Basic Input Component

Latest version **4.5.3** (published 2025-09-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install @hawk-ui/input
pnpm add @hawk-ui/input
yarn add @hawk-ui/input
bun add @hawk-ui/input
```

## Health

**Score 25/100 (F)** — status: maintenance-mode.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.5.3 |
| Published | 2025-09-25 |
| First published | 2019-12-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 40.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Saurabh Gaur |
| Maintainers | saurabh2112 |
| Keywords | input, react, react component, react input, hawk, hawk-ui, ui |

## Links

- npm: https://www.npmjs.com/package/@hawk-ui/input
- npm.io page: https://npm.io/package/@hawk-ui/input

## Dependencies (5)

- [lodash](https://npm.io/package/lodash.md) ^4.17.21
- [classnames](https://npm.io/package/classnames.md) ^2.3.2
- [prop-types](https://npm.io/package/prop-types.md) ^15.7.2
- [@hawk-ui/label](https://npm.io/package/@hawk-ui/label.md) ^4.5.3
- [@hawk-ui/tooltip](https://npm.io/package/@hawk-ui/tooltip.md) ^4.5.3

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 4.5.3 (latest) — 2025-09-25
- 4.5.2 — 2025-09-25
- 4.5.1 — 2025-07-15
- 4.5.0 — 2025-05-19
- 4.4.9 — 2025-05-19
- 4.4.8 — 2025-04-23
- 4.4.7 — 2025-02-19
- 4.4.6 — 2025-02-11
- 4.4.5 — 2025-02-11
- 4.4.4 — 2024-12-06
- 4.4.3 — 2024-12-05
- 4.4.2 — 2024-11-25
- 4.4.1 — 2024-07-18
- 4.4.0 — 2024-06-24
- 4.3.9 — 2024-06-24
- … 289 more at https://npm.io/package/@hawk-ui/input/versions

## README

## Installation


#### To install a component run
`$ npm install @hawk-ui/input --save`


#### Please import CSS styles via
```scss noeditor
@import '/path__to__node_modules/@hawk-ui/input/dist/index.min.css
```


## Usage


#### Without Label and Without Required:
[Demo](https://hawk.oncrypt.co/#!/Input/1)
```js static
import Input from '@hawk-ui/input';
```
```js
initialState = {
  value: '',
};

<Input
  type="text"
  value={state.value}
  onChange={(event) => {
    setState({
      value: event.target.value,
    });
  }}
  onEnter={(value) => {
    alert(value);
  }}
  placeholder="Enter Username"
  description="This is user input"
/>
```


#### With Copy
[Demo](https://hawk.oncrypt.co/#!/Input/3)
```js static
import Input from '@hawk-ui/input';
```
```js
initialState = {
  value: '',
};

<Input
  type="text"
  value={state.value}
  id="copy"
  isCopyable
  onChange={(event) => {
    setState({
      value: event.target.value,
    });
  }}
  onEnter={(value) => {
    alert(value);
  }}
  placeholder="Enter Username"
/>
```


#### With Password Visible
[Demo](https://hawk.oncrypt.co/#!/Input/5)
```js static
import Input from '@hawk-ui/input';
```
```js
initialState = {
  value: '',
};

<Input
  type="password"
  value={state.value}
  isPasswordVisible
  onChange={(event) => {
    setState({
      value: event.target.value,
    });
  }}
  onEnter={(value) => {
    alert(value);
  }}
  placeholder="Enter Username"
/>
```


#### With Label and With Required
[Demo](https://hawk.oncrypt.co/#!/Input/7)
```js static
import Input from '@hawk-ui/input';
```
```js
initialState = {
  value: '',
};

<Input
  type="text"
  onChange={(event) => {
    setState({
      value: event.target.value,
    });
  }}
  onEnter={(value) => {
    alert(value);
  }}
  placeholder="Enter Username"
  label="Username"
  isRequired
  isError
  errorMessage="This field is a compulsory field."
/>
```


#### Textarea With Label
[Demo](https://hawk.oncrypt.co/#!/Input/9)
```js static
import Input from '@hawk-ui/input';
```
```js
initialState = {
  value: '',
};

<Input
  type="text"
  isTextarea
  htmlAttributes={{
    rows: '3',
    cols: '30',
  }}
  onChange={(event) => {
    setState({
      value: event.target.value,
    });
  }}
  onEnter={(value) => {
    alert(value);
  }}
  placeholder="Enter Address"
  label="Address"
/>
```

---
_Source: https://npm.io/package/@hawk-ui/input · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
