Skip to content
React binding for @brianmcallister/highlight-text
TypeScript JavaScript
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci
demo
src
.babelrc
.eslintrc.js
.gitignore
.prettierrc.js
LICENSE
README.md
jest.config.js
package-lock.json
package.json
tsconfig.json

README.md

@brianmcallister/react-highlight-text

codecov CircleCI npm version

React binding for @brianmcallister/highlight-text

react-highlight-text is a React component that integrates with highlight-text.

Table of contents

Demo

Hosted demo: https://react-highlight-text.netlify.com/

You can also run the demo locally. To get started:

git clone git@github.com:brianmcallister/react-highlight-text.git
cd react-highlight-text/demo
npm i
npm start
⇡ Top

Installation

npm install @brianmcallister/react-highlight-text
⇡ Top

Usage

import HighlightText from '@brianmcallister/react-highlight-text';

const MyComponent = () => (
  <HighlightText
    text="Hello world! I'm highlighted!"
    words={['world', 'highlighted']}
  />
);
⇡ Top

API

HighlightText

This is the default export. Use this React component to highlight words in text.

interface Props {
  text: string;
  words: string[];
}
⇡ Top
You can’t perform that action at this time.