Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@addresszen/react

Package Overview
Dependencies
Maintainers
0
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@addresszen/react

Address Lookup React Component from AddressZen

  • 1.0.2
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
4
Maintainers
0
Weekly downloads
 
Created
Source

Address Lookup React Component

Address Lookup Demo

The <AddressLookup /> component is a wrapper around the @addresszen/address-lookup library. It provides a simple way to integrate the address lookup functionality into your React application.

  • Quickstart
  • Address Lookup Documentation
  • npm Module

Installation

npm i @addresszen/react

Usage

Default

By default, AddressLookup will render an input field that will trigger the address lookup when focused.

import { AddressLookup } from "@addresszen/react";

<AddressLookup
  // AddressLookup accepts the same props as an input element
  className="my-input-class"
  // AddressLookup also accepts a config prop
  config={{
    // Add your API Key
    apiKey: "ak_test",
    // Handle the address once it has been retrieved from the API
    onAddressRetrieved: (address) => {
      setState({ address });
    },
  }}
/>;

Bring Your Own Component

AddressLookup accepts a single React Element component as a child. This allows you to use your own input component.

import { AddressLookup } from "@addresszen/react";

<AddressLookup
  config={{
    apiKey: "ak_test",
    onAddressRetrieved: (a) => setState(a),
  }}
>
  <input className="my-input-class" placeholder="Enter your address" />
</AddressLookup>;

Configuration

The top level props provided to <AddressLookup /> configures the underlying attributes for the <input> element.

Configuration specific to the address lookup functionality is passed as a config prop.

The configuration object maps identically to the configuration object used by @addresszen/address-lookup. Find out more in our documentation.

Licence

Copyright IDDQD Limited

Keywords

FAQs

Package last updated on 07 Aug 2024

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