# react-input-children

> A replacement for the base component capable of rendering a child (link, button...) inside the input itself

Latest version **5.0.0** (published 2020-04-20) · ISC license · 0 weekly downloads

## Install

```sh
npm install react-input-children
pnpm add react-input-children
yarn add react-input-children
bun add react-input-children
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 5.0.0 |
| Published | 2020-04-20 |
| First published | 2016-01-21 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 26.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 16 |
| Author | Francesco Cioria |
| Maintainers | aslug, ecaml, ema_9000, gabro, giogonzo, malpenzibo, tpetrucciani, veej |
| Keywords | react, react-component, input, children, form, label, action, button |

## Links

- npm: https://www.npmjs.com/package/react-input-children
- Repository: https://github.com/buildo/react-input-children
- Issues: https://github.com/buildo/react-input-children/issues
- npm.io page: https://npm.io/package/react-input-children

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

- 5.0.0 (latest) — 2020-04-20
- 5.0.0-1 (next) — 2020-04-19
- 4.0.3 — 2020-04-05
- 4.0.2 — 2020-03-20
- 4.0.1 — 2018-01-18
- 4.0.0 — 2018-01-18
- 3.0.1 — 2017-12-04
- 3.0.0 — 2017-12-03
- 2.0.0 — 2017-11-10
- 1.0.2 — 2017-07-20
- 1.0.1 — 2016-09-14
- 1.0.0 — 2016-01-21

## README

# React Input Children

`InputChildren` is a replacement for the base input react component capable of rendering a child (link, button...) inside the input itself. It supports the same props of react input.

```jsx
import InputChildren from 'react-input-children';

React.renderComponent(
  <div>
    <InputChildren {...inputProps}>
      <a href="/forgot-password">Forgot?</a>
    </InputChildren>
  </div>,
  document.body);
```

![Screenshot](http://s3.postimg.org/5j5bvp8cj/Screen_Shot_2015_06_23_at_22_15_42.png)

[Live Examples](http://react-components.buildo.io/#inputchildren)

### Install
```
npm install --save react-input-children
```

### Under the hood
The JSX is structured as follows:
```html
<div>
  <input/>
  <div>
    {children}
  </div>
</div>
```

Inside *componentDidMount* `InputChildren` gets height and width of the child div wrapper and uses them to position it correctly inside the input and to give the correct right padding to the input itself.

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