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

autosuggest-highlight

Package Overview
Dependencies
Maintainers
3
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

autosuggest-highlight

Utilities for highlighting text in autosuggest and autocomplete components

  • 3.3.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
354K
increased by3.94%
Maintainers
3
Weekly downloads
 
Created

What is autosuggest-highlight?

The autosuggest-highlight npm package is used to highlight matching parts of suggestions in an autosuggest component. It is particularly useful in search interfaces where you want to visually emphasize the parts of the suggestion that match the user's input.

What are autosuggest-highlight's main functionalities?

Highlight Matching Parts

This feature allows you to highlight the parts of a suggestion that match the user's input. The `match` function finds the matching parts, and the `parse` function splits the text into highlighted and non-highlighted parts.

const highlight = require('autosuggest-highlight');
const text = 'California';
const query = 'cal';
const matches = highlight.match(text, query);
const parts = highlight.parse(text, matches);
console.log(parts); // [{ text: 'Cal', highlight: true }, { text: 'ifornia', highlight: false }]

Other packages similar to autosuggest-highlight

Keywords

FAQs

Package last updated on 24 Jul 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