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

@types/react-highlight-words

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/react-highlight-words

TypeScript definitions for react-highlight-words

  • 0.20.0
  • ts4.7
  • ts4.8
  • ts4.9
  • ts5.0
  • ts5.1
  • ts5.2
  • ts5.3
  • ts5.4
  • ts5.5
  • ts5.6
  • ts5.7
  • ts5.8
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
238K
decreased by-4.8%
Maintainers
1
Weekly downloads
 
Created

What is @types/react-highlight-words?

@types/react-highlight-words provides TypeScript definitions for the react-highlight-words package, which is a React component for highlighting words within a larger body of text.

What are @types/react-highlight-words's main functionalities?

Basic Highlighting

This feature allows you to highlight specific words within a larger body of text. The `searchWords` array contains the words to be highlighted, and `textToHighlight` is the text where the words will be highlighted.

import Highlighter from 'react-highlight-words';

const text = 'The quick brown fox jumps over the lazy dog';
const searchWords = ['quick', 'fox', 'lazy'];

<Highlighter
  highlightClassName="YourHighlightClass"
  searchWords={searchWords}
  autoEscape={true}
  textToHighlight={text}
/>;

Custom Highlighting Styles

This feature allows you to apply custom styles to the highlighted words. The `highlightStyle` prop is used to define the CSS styles for the highlighted words.

import Highlighter from 'react-highlight-words';

const text = 'The quick brown fox jumps over the lazy dog';
const searchWords = ['quick', 'fox', 'lazy'];

<Highlighter
  highlightStyle={{ backgroundColor: 'yellow', fontWeight: 'bold' }}
  searchWords={searchWords}
  autoEscape={true}
  textToHighlight={text}
/>;

Case Insensitive Highlighting

This feature allows you to perform case-insensitive highlighting. By setting the `caseSensitive` prop to `false`, the component will highlight words regardless of their case.

import Highlighter from 'react-highlight-words';

const text = 'The quick brown fox jumps over the lazy dog';
const searchWords = ['Quick', 'FOX', 'lazy'];

<Highlighter
  highlightClassName="YourHighlightClass"
  searchWords={searchWords}
  autoEscape={true}
  caseSensitive={false}
  textToHighlight={text}
/>;

Other packages similar to @types/react-highlight-words

FAQs

Package last updated on 29 May 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