# M text highlight 2

> Hover triggered — highlight fills in on mouse enter and resets on leave

A shadcn/ui block from the [@cnippet](https://ui.cnippet.dev/) registry, listed on [shadcn.exchange](https://shadcn.exchange/r/cnippet/m-text-highlight-2).

- Page, with a live preview: https://shadcn.exchange/r/cnippet/m-text-highlight-2
- Screenshot: https://abzjhwgwpdpz7ua5.public.blob.vercel-storage.com/shots/cnippet/m-text-highlight-2-light-f08a62dd58d7c2d2.png
- Registry item: https://ui.cnippet.dev/r/m-text-highlight-2.json
- Categories: text highlight
- Listed: 2026-10-13, source last changed 2026-10-13

## Install

```bash
npx shadcn@latest add https://ui.cnippet.dev/r/m-text-highlight-2.json
```

Run it in a project that has shadcn/ui set up. It adds the files below and installs what they depend on.

## Dependencies

- Registry items: `@cnippet/text-highlight`

## Files

### `registry/default/motion-variants/m-text-highlight-2.tsx`

```tsx
"use client";

import { TextHighlight } from "@/registry/default/motion/text-highlight";

export default function TextHighlightHover() {
  return (
    <div className="flex min-h-50 flex-col items-center justify-center gap-4 px-6">
      <p className="text-muted-foreground text-sm">Hover to highlight</p>
      <p className="max-w-lg text-center font-semibold text-2xl text-foreground leading-snug">
        Design systems that feel{" "}
        <TextHighlight
          className="rounded px-0.5"
          highlightColor="hsl(45, 95%, 75%)"
          transition={{ bounce: 0, duration: 0.5, type: "spring" }}
          triggerType="hover"
        >
          alive
        </TextHighlight>
        , not just correct.
      </p>
    </div>
  );
}
```
