Kinetik UI

Marker Highlight

.md

A paragraph where key phrases get marked as if with a highlighter, the ink sweeping in phrase by phrase.

v1.0.0Live on webreact-native-reanimatedreact-native-worklets
Component preview

Installation

Kinetik CLI
npx kinetik-ui add marker-highlight

The CLI copies the source and installs native dependencies with npx expo install, so versions match your Expo SDK. With shadcn: npx shadcn@latest add https://kinetik-ui.dev/r/marker-highlight.json

Install manually

  1. Install dependencies
    npx expo install react-native-reanimated react-native-worklets
  2. Copy the source files
    • components/kinetik/marker-highlight.tsx
    View source files

Usage

import { MarkerHighlight } from '@/components/kinetik/marker-highlight';

<MarkerHighlight
  text="Plan trips together and keep every booking in one place."
  highlights={['together', 'every booking']}
/>;

Each phrase marks its first match after the previous one, so list them in reading order. variant="underline" draws a line under the words instead of painting behind them.

When to use

  • A sentence or two on a landing or onboarding screen where two or three phrases carry the message.
  • Pull quotes and summaries, to guide the eye to what matters.

When not to use

  • Body text and long articles. Marking everything marks nothing.
  • Search results. Matches should be visible at once, not sweep in.

Notes

  • Set play when the paragraph scrolls into view; it starts unmarked and sweeps when play turns true.
  • The ink runs word by word, so it follows the text across line breaks.
  • The marking is visual only; screen readers read the paragraph as plain text.
  • With reduced motion the phrases appear already marked.

Props

MarkerHighlightProps

PropTypeDefaultDescription
textrequiredstring—
highlightsrequiredreadonly string[]—Phrases in `text` to mark, in reading order. Each marks its first match.
variant'marker' | 'underline''marker'`marker` paints behind the words; `underline` draws a line under them. Defaults to `marker`.
colorstring—Ink colour. Defaults to the theme azure.
playbooleantrueRun the sweep. Set it when the text scrolls into view; defaults to true (on mount).
delaynumber250Wait before the first sweep, in ms. Defaults to 250.
speednumber28Time to sweep one character, in ms. Defaults to 28.
styleStyleProp<TextStyle>—
highlightStyleStyleProp<TextStyle>—Style for marked words, on top of `style`.
containerStyleStyleProp<ViewStyle>—

Performance and accessibility

Performance

Budget
One clock drives every stroke of ink on the UI thread; words are plain text views that wrap like a paragraph.
Measured

Pixel 9 emulator, API 35, release build · interaction median 0.90× the system Settings app on the same emulator (indicative only) · no frames drawn at rest · 148 MB app memory

Real-device measurement pending.

Accessibility

Reduced motion
Phrases appear already marked.
Screen readers
Reads as one piece of text; the marking is visual only.
Touch target
Not interactive.

Source files

components/kinetik/marker-highlight.tsx is in the Code tab of the preview above.