# @cpelements/cp-search-autocomplete

> Cp search autocomplete element for PatternFly Elements

Latest version **2.0.1** (published 2026-08-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install @cpelements/cp-search-autocomplete
pnpm add @cpelements/cp-search-autocomplete
yarn add @cpelements/cp-search-autocomplete
bun add @cpelements/cp-search-autocomplete
```

## Health

**Score 60/100 (C)** — status: active.

Positive: esm support; no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads; no types.

## Facts

| | |
|---|---|
| Version | 2.0.1 |
| Published | 2026-08-20 |
| First published | 2020-06-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 82.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 396 |
| Maintainers | eyevana, rlahoda, tylermart10, kylebuch8, kelss, wesruv, jordanpagewhite, fwang830, dfaucette, akshayadn, bexter89, devhsharma, cgatyas, arakumar, asacolips, diwanshipandey, denair, didiohreally |
| Keywords | web-components, html |

## Links

- npm: https://www.npmjs.com/package/@cpelements/cp-search-autocomplete
- Repository: https://github.com/patternfly/patternfly-elements
- Homepage: https://github.com/patternfly/patternfly-elements#readme
- Issues: https://github.com/patternfly/patternfly-elements/issues
- npm.io page: https://npm.io/package/@cpelements/cp-search-autocomplete

## Dependencies (1)

- [@patternfly/pfe-autocomplete](https://npm.io/package/@patternfly/pfe-autocomplete.md) 1.12.3

## Alternatives

- [@tsparticles/shape-image](https://npm.io/package/@tsparticles/shape-image.md) — 303.7K weekly downloads
- [@tsparticles/shape-line](https://npm.io/package/@tsparticles/shape-line.md) — 233.7K weekly downloads
- [stringify-attributes](https://npm.io/package/stringify-attributes.md) — 58.6K weekly downloads
- [mobile-drag-drop](https://npm.io/package/mobile-drag-drop.md) — 46.3K weekly downloads
- [@comunica/actor-rdf-parse-html](https://npm.io/package/@comunica/actor-rdf-parse-html.md) — 29.2K weekly downloads

## Recent versions

- 2.0.1 (latest) — 2026-08-20
- 2.0.0 — 2026-07-17
- 0.0.10 — 2025-08-04
- 0.0.9 — 2023-03-29
- 0.0.8 — 2022-08-31
- 0.0.7 — 2022-08-23
- 1.0.0 — 2021-03-01
- 0.0.6 — 2020-08-21
- 0.0.5 — 2020-06-23
- 0.0.3 — 2020-06-19
- 0.0.2 — 2020-06-15
- 0.0.1 — 2020-06-09

## README

# PatternFly Element | Cp search autocomplete element
## Usage
`cp-search-autocomplete` is a wrapper for `pfe-autocomplete` that enables users to specify an autosuggest API path and optional placeholder text for use on the RH Customer Portal.

```html
<cp-search-autocomplete
  path="https://api.example.com/path/to/autosuggest/endpoint"
  client="portal-search">
</cp-search-autocomplete>
```

### Accessibility
This component has full keybaord and screen reader functionality.

## Attributes
- `path`: URL for the portal autosuggest API.
- `client`: value sent as the `redhat_client` query parameter.
- `placeholder`: optionally override the default placeholder text
- `query`: set the default value for the input field in pfe-autocomplete
- `num-items`: change the default number of items (5) in the dropdown for pfe-autocomplete

Suggestions are requested after the user enters at least two characters.

## Dependencies
`@patternfly/pfe-autocomplete`

## Dev

    `npm start`

## Test

    `npm run test cp-search-autocomplete -- -p`
the `-p` flag means it will persist, simply refresh the test in the test browser window to use in development

## Build

    `npm run build`

## Demo

From the PFElements root directory, run:

    `npm run demo`
the demo page will launch with a table of contents to view each element. the css can take a while to build, so you may need to refresh the elements page after clicking on it.

## Code style

Cp search autocomplete (and all PFElements) use [Prettier][prettier] to auto-format JS and JSON. The style rules get applied when you commit a change. If you choose to, you can [integrate your editor][prettier-ed] with Prettier to have the style rules applied on every save.

[prettier]: https://github.com/prettier/prettier/
[prettier-ed]: https://prettier.io/docs/en/editors.html
[web-component-tester]: https://github.com/Polymer/web-component-tester

---
_Source: https://npm.io/package/@cpelements/cp-search-autocomplete · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
