Highlight
Highlight given part of a string with mark tag
Import
Source
Docs
Package
Usage
Use Highlight component to highlight a substring in a given string with mark tag.
Pass main string as children to Highlight component and string part that should be highlighted to highlight
prop.
If main string does not include highlight
part, it will be ignored.
Component ignores trailing whitespace and highlights all matched characters sequence.
Highlight This, definitely THIS and also this!
HighlightColor
Highlight multiple substrings
To highlight multiple substrings, provide an array of values:
Highlight this and also that
Change highlight styles
Default Mark styles can be overwritten with highlightStyles
prop, it accepts either function with a subscription to theme
or an object with styles:
You can change styles of highlighted part if you do not like default styles
Text props
Highlight accepts the same props as Text component: