# react-postcode

> ![](demo.gif)

Latest version **2.0.0** (published 2020-04-23) · ISC license · 0 weekly downloads

## Install

```sh
npm install react-postcode
pnpm add react-postcode
yarn add react-postcode
bun add react-postcode
```

## 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 | 2020-04-23 |
| First published | 2020-01-20 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 12.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | dan-kwiat |

## Links

- npm: https://www.npmjs.com/package/react-postcode
- npm.io page: https://npm.io/package/react-postcode

## Dependencies (2)

- [filter-suggest](https://npm.io/package/filter-suggest.md) 3.5.5
- [lodash.debounce](https://npm.io/package/lodash.debounce.md) ^4.0.8

## Recent versions

- 2.0.0 (latest) — 2020-04-23
- 1.2.0 — 2020-02-06
- 1.1.0 — 2020-01-29
- 1.0.6 — 2020-01-22
- 1.0.5 — 2020-01-22
- 1.0.4 — 2020-01-22
- 1.0.3 — 2020-01-20
- 1.0.2 — 2020-01-20
- 1.0.1 — 2020-01-20
- 1.0.0 — 2020-01-20

## README

# Postcode Search: React Component

![](demo.gif)

## Docs

#### Installing

- `yarn add postcode-search`

Make sure you have the peer dependencies installed too:

- `yarn add react prop-types`

#### Importing Component

```js
import PostcodeSearch from 'react-postcode'
```

#### Importing Styles

```js
import 'react-postcode/dist/index.css'
```

#### Props

- `apiKey: string`
- `apiUrl: string`
- `className: string`
- `label: string`
- `mapItem: func`
- `menuClassName: string`
- `onBlur: func`
- `onFetch: func`
- `onFocus: func`
- `onSelect: func`
- `outlined: bool`
- `style: object`
- `textFieldClassName: string`

#### Example

```jsx
import React from 'react'
import PostcodeSearch from 'react-postcode'
import 'react-postcode/dist/index.css'

const App = () => (
  <div style={{ maxWidth: '200px', margin: '100px auto', }}>
    <PostcodeSearch
      onFetch={postcode => {
        console.log(postcode)
      }}
    />
  </div>
)
```

## Developing

- `yarn`
- `yarn start`

The component is rendered at `http://localhost:3001` and updates automatically when editing the source code in [./src/index.js](./src/index.js).

## Publishing

- `yarn publish`

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