React Native MantineTypography

Highlight

Highlight specific text portions

Import: import { Highlight } from 'react-native-mantine';

Usage

import { Highlight  } from 'react-native-mantine';

// Single word
<Highlight highlight="React">
  Build apps with React Native
</Highlight>

// Multiple words
<Highlight highlight={["fast", "reliable"]}>
  Our components are fast and reliable
</Highlight>

// Custom color
<Highlight
  highlight="important"
  highlightColor="red"
>
  This is an important message
</Highlight>

Props

PropTypeDefaultDescription
highlight (required)string | string[]Substring or array of substrings to highlight within the text
children (required)stringText in which to highlight substrings (must be a string)
highlightColorstring'yellow'Color key from theme.colors for highlighted text background
highlightStyles{ backgroundColor?: string; color?: string; }Custom styles for highlighted text portions (overrides highlightColor)
styleTextStyleAdditional styles to apply to the entire text
sizestringText size from theme (inherited from Text)
colorstringText color for non-highlighted portions
whitebooleanfalseSets text color to white
boldbooleanfalseApplies bold font weight
semiBoldbooleanfalseApplies semi-bold font weight
weight'100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900'Font weight - numeric values from 100 (thin) to 900 (black)
align'left' | 'center' | 'right' | 'justify'Text alignment

Source on GitHub · npm