ReactTextIlluminator is a React component designed to highlight specific text within a larger body of text. It can be useful for indicating search results, highlighting keywords, or emphasizing certain terms.
You can install the ReactTextIlluminator component
via npm:
npm i react-text-illuminator
or via yarn:
yarn add react-text-illuminator
- Text Highlighting
- SEO Friendly
- Zero dependencies: Self-contained solution, ensuring reliability and ease of deployment.
- Customization of Highlight Term
- Customization of Highlight Color
- Support for Complex Text
- Escape of Special Characters
Live:
The ReactTextIlluminator component accepts the following props:
To use the ReactTextIlluminator component, simply import it into your React application and include it in your JSX markup.
import React from 'react';
import ReactTextIlluminator from 'react-text-illuminator';
const App = () => {
return (
<div>
<h1>Search Results</h1>
<ReactTextIlluminator
textContent="Lorem ipsum dolor sit amet, consectetur adipiscing elit."
highlightTerm="Lorem"
highlightColor="yellow"
/>
</div>
);
};
export default App;
Hello everyone, I'm fredarcito, a Frontend engineer in constant learning. I only know that I don't know anything, but Google knows.
If you have any feedback, please reach out to us at freddy@gogrow.dev