Skip to content

    Browse components

    Text Highlighter

    A marker-pen stroke swipes behind chosen words as they scroll into view, flipping the ink color in sync.

    Open
    Customize

    marker
    underline
    ltr
    rtl

    Installation

    npx shadcn@latest add @glint-ui/text-highlighter

    First time using @glint-ui? Add the registry to components.json once, or install by URL: npx shadcn@latest add https://glintui.vercel.app/r/text-highlighter.json

    Usage

    import { TextHighlighter } from "@/components/ui/text-highlighter";
    
    <p>Ship <TextHighlighter>small, sharp</TextHighlighter> releases.</p>

    Props

    PropTypeDefaultDescription
    childrenReactNode—The words to highlight.
    colorstring"#a3e635"Marker color.
    textColorstring"#0a0a0a"Text color while highlighted (marker variant).
    variant"marker" | "underline""marker"Full marker stroke, or a low underline swipe.
    direction"ltr" | "rtl""ltr"Direction the pen travels.
    durationnumber900Stroke duration, in ms.
    delaynumber0Delay after entering view, in ms.
    classNamestring—Extra classes for the root element.