# ink-password-input

> Password input component for Ink

Latest version **2.0.0** (published 2018-05-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install ink-password-input
pnpm add ink-password-input
yarn add ink-password-input
bun add ink-password-input
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2018-05-20 |
| First published | 2017-07-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=6 |
| Dependencies | 2 |
| Unpacked size | 5.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 16 |
| Author | Vadim Demedes |
| Maintainers | vdemedes |
| Keywords | ink, text, input, component, jsx, react, stdin, keypress, search, query |

## Links

- npm: https://www.npmjs.com/package/ink-password-input
- Repository: https://github.com/vadimdemedes/ink-password-input
- Homepage: https://github.com/vadimdemedes/ink-password-input#readme
- Issues: https://github.com/vadimdemedes/ink-password-input/issues
- npm.io page: https://npm.io/package/ink-password-input

## Dependencies (2)

- [has-ansi](https://npm.io/package/has-ansi.md) ^3.0.0
- [prop-types](https://npm.io/package/prop-types.md) ^15.5.10

## 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

- 2.0.0 (latest) — 2018-05-20
- 1.1.0 — 2017-07-15
- 1.0.0 — 2017-07-10

## README

# ink-password-input [![Build Status](https://travis-ci.org/vadimdemedes/ink-password-input.svg?branch=master)](https://travis-ci.org/vadimdemedes/ink-password-input)

> Password input component for [Ink](https://github.com/vadimdemedes/ink).


## Install

```
$ npm install ink-password-input
```


## Usage

```jsx
const {h, render, Component} = require('ink');
const PasswordInput = require('ink-password-input');

class Auth extends Component {
	constructor(props) {
		super(props);

		this.state = {
			password: ''
		};

		this.handleChange = this.handleChange.bind(this);
		this.handleSubmit = this.handleSubmit.bind(this);
	}

	render(props, state) {
		return (
			<span>
				Password:

				<PasswordInput
					value={state.password}
					placeholder="Enter your password"
					onChange={this.handleChange}
					onSubmit={this.handleSubmit}
				/>
			</span>
		);
	}

	handleChange(value) {
		this.setState({
			password: value
		});
	}

	handleSubmit(value) {
		// Password submitted
	}
}

render(<Auth/>);
```

<img src="media/demo.gif" width="544">


## Props

### value

Type: `string`

Value to display in a password input.

### mask

Type: `string`<br>
Default: `*`

Mask char to replace each char of the `value` with.

### placeholder

Type: `string`

Text to display when `value` is empty.

### onChange

Type: `Function`

Function to call when value updates.

### onSubmit

Type: `Function`

Function to call when user press <kbd>Enter</kbd>.


## License

MIT © [Vadim Demedes](https://github.com/vadimdemedes)

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