1.0.1 • Published 4 years ago

@alduncanson/react-address-autocomplete v1.0.1

Weekly downloads
16
License
MIT
Repository
github
Last release
4 years ago

react-address-autocomplete

npm license min

stars

A simple text input for entering addresses using Google's Places API. You can try it out here!

Demo

react address autocomplete demo gif

Install

Requires React 16 or later

npm install --save @alduncanson/react-address-autocomplete

or

yarn add @alduncanson/react-address-autocomplete

Usage

import React from 'react'
import './App.css'

import AddressInput from '@alDuncanson/react-address-autocomplete'

export const App = () => {
  return (
    <div className='App'>
      <header className='App-header'>
        <div style={{ width: '34%' }}>
          <AddressInput apiKey='YOUR API KEY' handleAddress={address => console.log(address)}/>
        </div>
      </header>
    </div>
  )
}

After you start typing, you can then navigate through the prediction list with your mouse or keyboard with and arrow keys and select your address by clicking or pressing the Enter key

Props

  • style: Object - style object for the <input/> element
  • placeholder: String - input placeholder text. Otherwise defaults to 'Address'
  • handleAddress: Callback - a function that takes the selected address as a parameter and returns it as a string
  • apiKey: String - your Google Places API Key

Contributing

Pull requests are welcome and greatly appreciated. As new as this module is, I am still working on setting up a proper contribution flow as well as making an actual build/bundling script to make helping out easier. If you have suggestions, submit them as an issue please :)

1.0.1

4 years ago

1.0.0

4 years ago

0.1.26

4 years ago

0.1.25

4 years ago

0.1.23

4 years ago

0.1.24

4 years ago

0.1.22

4 years ago

0.1.21

4 years ago

0.1.20

4 years ago

0.1.18

4 years ago

0.1.19

4 years ago

0.1.17

4 years ago

0.1.15

4 years ago

0.1.14

4 years ago

0.1.13

4 years ago

0.1.12

4 years ago

0.1.11

4 years ago

0.1.10

4 years ago

0.1.9

4 years ago

0.1.8

4 years ago

0.1.7

4 years ago

0.1.6

4 years ago

0.1.5

4 years ago

0.1.4

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.3

4 years ago

0.1.0

4 years ago