npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@pro6pp/infer-react

v0.0.2-beta.14

Published

Headless React one-field input for the Pro6PP Infer API.

Readme

Pro6PP Infer React SDK

React Hook for the Pro6PP Infer API. A headless library to build custom address autocomplete components in React.

Installation

npm install @pro6pp/infer-react

Usage

The Pro6PPInfer component provides a styled address autocomplete input.

import React from 'react';
import { Pro6PPInfer } from '@pro6pp/infer-react';

const AddressForm = () => {
  return (
    <div className="form-group">
      <label>Search Address</label>
      <Pro6PPInfer
        authKey="YOUR_AUTH_KEY"
        country="NL"
        onSelect={(selection) => console.log('Selected:', selection)}
        placeholder="Type a Dutch address..."
      />
    </div>
  );
};

You can customize the appearance of the component via the following props:

| Prop | Description | | :--------------------- | :---------------------------------------------------------------------------------------- | | className | Optional CSS class name for the wrapper div. | | disableDefaultStyles | If true, prevents the automatic injection of the default CSS theme. | | placeholder | Custom placeholder text for the input field. | | noResultsText | The text to display when no suggestions are found. | | renderItem | A custom render function for suggestion items, receiving the item and isActive state. | | renderNoResults | A custom render function for the empty state, receiving the current state. | | debounceMs | Delay in ms before API search. Defaults to 150 (min 50). | | maxRetries | Maximum retry attempts for transient network errors. Valid range: 0 to 10. | | showClearButton | If true, displays a button to empty the input field. Defaults to true. | | loadMoreText | The text to display on the pagination button. |


Alternatively, you can use the headless useInfer hook. This hook handles all the logic (state, API calls, debouncing, keyboard navigation), but allows you to build your own custom UI.

import React from 'react';
import { useInfer } from '@pro6pp/infer-react';

const CustomAddressForm = () => {
  const { state, inputProps, selectItem } = useInfer({
    authKey: 'YOUR_AUTH_KEY',
    country: 'NL',
    limit: 5,
  });

  return (
    <div className="address-autocomplete">
      <label>Address</label>

      {/* inputProps contains value, onChange, and onKeyDown */}
      <input {...inputProps} placeholder="Type an address..." className="my-input-class" />

      {state.isLoading && <div className="spinner">Loading...</div>}

      {/* render the dropdown */}
      {(state.suggestions.length > 0 || state.cities.length > 0) && (
        <ul className="my-dropdown-class">
          {/* render cities */}
          {state.cities.map((city, i) => (
            <li key={`city-${i}`} onClick={() => selectItem(city)}>
              <strong>{city.label}</strong> (City)
            </li>
          ))}

          {/* render streets */}
          {state.streets.map((street, i) => (
            <li key={`street-${i}`} onClick={() => selectItem(street)}>
              <strong>{street.label}</strong> (Street)
            </li>
          ))}

          {/* render general suggestions */}
          {state.suggestions.map((item, i) => (
            <li key={`suggestion-${i}`} onClick={() => selectItem(item)}>
              {item.label}
            </li>
          ))}
        </ul>
      )}

      {state.isValid && <p>Valid address selected.</p>}
    </div>
  );
};