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

@patternfly/pfe-autocomplete

Package Overview
Dependencies
Maintainers
16
Versions
74
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@patternfly/pfe-autocomplete

Autocomplete for PatternFly Elements

  • 2.0.0-next.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
158
increased by295%
Maintainers
16
Weekly downloads
 
Created
Source

PatternFly Elements Autocomplete

<pfe-autocomplete> is a Web Component that provides options in a dropdown list as user types in an input box by showing result from an api call.

Read more about Autocomplete in the PatternFly Elements Autocomplete documentation

Installation

Load <pfe-autocomplete> via CDN:

<script src="https://unpkg.com/@patternfly/pfe-autocomplete?module"></script>

Or, if you are using NPM, install it

npm install @patternfly/pfe-autocomplete

Then once installed, import it to your application:

import '@patternfly/pfe-autocomplete';

Usage

<pfe-autocomplete debounce="500" init-value="uni">
  <input placeholder="Enter Your Search Term" />
</pfe-autocomplete>
const autocomplete = document.querySelector('autocomplete');
autocomplete.autocompleteRequest = function (params, callback) {
  autocomplete.loading = true;
  const url = new URL('http://openlibrary.org/search.json');
        url.searchParams.append('title', params.query);
  fetch(url.toString())
    .then(x => x.json())
    .then(({ docs }) => docs.map(x => x.title))
    .then(callback)
    .then(() => autocomplete.loading = false);
};

Keywords

FAQs

Package last updated on 04 Mar 2022

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