2.0.0 • Published 4 years ago

react-postcode v2.0.0

Weekly downloads
5
License
ISC
Repository
-
Last release
4 years ago

Postcode Search: React Component

npm.io

Docs

Installing

  • yarn add postcode-search

Make sure you have the peer dependencies installed too:

  • yarn add react prop-types

Importing Component

import PostcodeSearch from 'react-postcode'

Importing Styles

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

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.

Publishing

  • yarn publish
2.0.0

4 years ago

1.2.0

4 years ago

1.1.0

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago