TextHighlight

A marker pen that swipes behind chosen phrases as the text scrolls into view, one after another. Text.

Open playground

Design is how it works, and motion is how it feels.

About

TextHighlight is a React component in the Text category of smoui. It is typed, ships no stylesheet, follows your theme through CSS variables, and honors prefers-reduced-motion. Import it with import { TextHighlight } from "@ashutoshswamy/smoui" and set text, marks, color.

Install

Terminal
npm i @ashutoshswamy/smoui

Usage

TSX
import { TextHighlight } from "@ashutoshswamy/smoui";

<TextHighlight text="Design is how it works, and motion is how it feels." marks={["how it works", "how it feels"]} />

Props 3

text

Full text.

string
marks

Substrings to highlight, in order.

string[]
color

Marker color. Defaults to a soft tone of the accent.

string