New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-loqate

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-loqate

This is a React implementation of the loqate APIs. It features an input, typing in which will result in a list of address options. Clicking an option will trigger your callback with that option

  • 0.2.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3.7K
decreased by-20.36%
Maintainers
1
Weekly downloads
 
Created
Source

React-Locate

This is a React implementation of the loqate APIs. It features an input, typing in which will result in a list of address options. Clicking an option will trigger your callback with that option

Usage

Notes

You must polyfill fetch.

Props

nametyperequiredexampledescription
apiKeystringyes"AA11-AA11-AA11-AA11"Loqate API key
localestringyes"en_GB"Language to be used
onSelect(address) => voidyesaddress => console.log(address)Callback with for Loqate response
countriesstring[]no["GB", "NL"]Countries to search in
limitnumberno10Number of options to show
inputClassnamestringno"address-input"Classname for the input
listClassnamestringno"address-options"Classname for the list
listItemClassnamestringno"address-option"Classname for the list items
componentssee Customizationnosee CustomizationComponents to overwrite the default ones

Customization

You can either style the existing input, list and listItem with their respective classes or replace them completely by passing in your own components in the components prop.

List component must be able to accept a ref! All components must pass down their props!

import React from 'react';

const AddressSearchInput = (props): JSX.Element => {
  return (
    <input
      placeholder={'start typing your address or postcode'}
      autocomplete="chrome-off"
      {...props}
    />
  );
};

<AddressSearch
  locale="en_GB"
  apiKey="AA11-AA11-AA11-AA11"
  countries={['GB']}
  components={{ Input: AddressSearchInput }}
  listItemClassname="list-item"
  onSelect={address => console.log(address)}
/>;

FAQs

Package last updated on 17 Dec 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc