Text Highlighter

TextHighlighter with smooth animated highlights to emphasize key text.

The best way to win is to
share

Installation

npx shadcn@latest add https://scrollxui.dev/registry/text-highlighter.json 

Usage

import TextHighlighter from "@/components/ui/text-highlighter";
<TextHighlighter type="wavy" highlightColor="#00ffb7ff">
  <span>share</span>
</TextHighlighter>

Examples


Zigzag

Life is a journey full of
twists

API Reference

Text Highlighter

TextHighlighter with smooth animated highlights to emphasize key text.

Props

PropertyTypeDefaultDescription
childrenReactNoderequired
The text or elements to be highlighted.
highlightColorstring#ff6b9d
Color of the highlight stroke applied under the text.
highlightOpacitynumber1
Opacity of the highlight stroke (0 to 1).
animationDurationnumber1.2
Duration of the highlight drawing animation in seconds.
animationDelaynumber0
Delay before the highlight animation starts (in seconds).
strokeWidthnumber2
Width of the highlight stroke.
classNamestring''
Additional CSS classes for the wrapper span.
styleReact.CSSProperties{}
Inline styles applied to the wrapper span.
type'wavy' | 'zigzag''wavy'
Type of highlight path shape drawn beneath the text.
triggerOnViewbooleantrue
If true, the animation triggers when the element enters the viewport.
repeatbooleanfalse
If true, animation retriggers every time the element enters the viewport.

Built withby Ahdeetai.