Homelogologo
Sponsor

Highlight

Highlights specified substrings within text.

Usage

Use the Highlight component to emphasize substrings in text that match the provided query.

import { Text, Highlight } from "@elemnts-ui/react";
<Text> <Highlight query="..." text="..." /> </Text>

Multiple

Set the query prop to an array of strings to highlight multiple substrings.

Search Query

Use the Highlight component to emphasize terms in search results that match the user's query.

Squiggle

This example demonstrates how to wrap highlighted text with a custom squiggle image for a more decorative effect.

API Reference

PropTypeDefault
variantprimary | secondary | tertiary | underlineprimary
querystring | string[]undefined
textstringundefined
ignoreCasebooleanundefined
matchAllbooleanundefined
exactMatchbooleanundefined