# Highlighter

> A marker stroke sweeps across a key phrase.

## Spec sheet

| | |
| --- | --- |
| Access | Free: no account, free for commercial use |
| Shelf | Text Animations › Entrances |
| Live preview | https://uibrik.com/components/highlighter |
| Writes | 1 file into `components/uibrik/highlighter/` |
| Packages | `motion` (the CLI installs them) |
| Needs | React 19, Tailwind CSS v4, a project set up with `npx shadcn@latest init` |
| Theme | Reads the shadcn tokens and follows class-based dark mode ([theming](https://uibrik.com/docs/theming.md)) |
| Updated | Nov 9, 2026 |

## Add it

```bash
npx shadcn@latest add https://uibrik.com/r/highlighter.json
```

With the `@uibrik` namespace in `components.json` ([setup](https://uibrik.com/docs/installation.md)): `npx shadcn@latest add @uibrik/highlighter`.

Can't run commands? https://uibrik.com/components/highlighter/prompt.txt has every file verbatim, with the setup steps, ready for an assistant to write.

## Render it

Renders as is; every value shown is the default, so delete any line you don't need.

```tsx
import { Highlighter } from "@/components/uibrik/highlighter/highlighter";

<Highlighter
  play={0}
  text="Read the"
  highlight="part that matters"
  duration={0.5}
  color=""
/>
```

## Tune it

The same props as the Customize panel on https://uibrik.com/components/highlighter.

| Prop | Type | Default | What it does |
| --- | --- | --- | --- |
| `text` | `string` | `"Read the"` | Text before the highlighted phrase. |
| `highlight` | `string` | `"part that matters"` | The phrase the marker sweeps behind. |
| `duration` | `number` | `0.5` | Time for the marker to sweep across. |
| `color` | `string` | `""` | Marker colour. Empty follows the theme. |

## Wire it

The props the Customize panel doesn't show: ranges, data, content and callbacks.

| Prop | Type | Default | What it does |
| --- | --- | --- | --- |
| `play` (required) | `number` |  | Each change plays the effect again; 0 shows its resting state. |

## Where it fits

- **Key phrases in headlines**: A marker sweeping across two or three words tells visitors what matters most.
- **Blog posts and docs**: Highlighting a term as it scrolls into view guides readers to the main point. Pairs with [Scroll to Highlight](https://uibrik.com/components/scroll-highlight.md).
- **Pricing callouts**: Marking "free for 14 days" or a discount draws the eye without a badge.

## Same shelf: Entrances

- [Line-by-line Rise](https://uibrik.com/components/line-rise.md): Each wrapped line rises into place in turn.
- [Outline then Fill](https://uibrik.com/components/outline-fill.md): Letters are drawn as outlines, then filled in.
- [Plucked Curve](https://uibrik.com/components/plucked-curve.md): Text rides a curve that wobbles like a plucked string.
- [Ripple to Still](https://uibrik.com/components/ripple-to-still.md): Text ripples like water, then settles.
- [Scramble Text](https://uibrik.com/components/scramble-text.md): Letters resolve from random characters out of a soft blur, one after another.
- [Scroll to Highlight](https://uibrik.com/components/scroll-highlight.md): Words light up as you scroll past them.

## Ground rules

- Only the props above exist. To change anything else, edit the installed file.
- Keep the files in `components/uibrik/highlighter/` so the import paths keep resolving.
- The playbook for working with the whole library: https://uibrik.com/llms.txt
