Default
A swipe behind a phrase. Select the text, copy it: it is still just words.
A highlighter swipe behind real words. The phrase stays text you can select and copy; the swipe follows it line by line when it wraps, in yellow or any stationery color, and can draw itself on as it scrolls into view.
npx shadcn@latest add @wobko/highlight第一次使用?先把 registry 加进 components.json。 如何安装
A swipe behind a phrase. Select the text, copy it: it is still just words.
Yellow is the highlighter. Pink, green, blue, orange, lilac and teal are the stationery accents held as translucent markers.
A phrase that runs onto three lines gets three swipes, one per line, that start and stop where the words do. Press replay to watch it being drawn.
Highlights inside a card: the swipe sits on the paper, behind the words, and the card's tilt never touches the text.
A <mark> (or your own element with asChild) that hosts the drawing. One aria-hidden swipe per line of the phrase, measured from the browser's own line boxes, so it starts and ends where the words do.
| 属性 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| tone | "yellow" | "pink" | "green" | "blue" | "orange" | "lilac" | "teal" | "yellow" | The marker. Yellow is the highlighter; the rest are the stationery accents as translucent markers. |
| weight | "light" | "regular" | "heavy" | "regular" | How fat the marker is held. |
| cover | "full" | "under" | "full" | full covers the letters; under runs along the lower half of the line so the words stay clear above it. |
| animate | boolean | false | Hold the swipe back and draw it on, left to right, the first time the phrase scrolls into view. Reduced motion just shows it. |
| show | boolean | true | Show or hide the swipe. With animate, turning it on plays the draw-on. |
| delay | number | - | Milliseconds to wait before the first line draws on; each further line follows a beat later. |
| seed | string | number | - | Pins the hand. Default: derived from useId(), so server and client draw the same swipe. |
| asChild | boolean | false | Render the swipe on your own child element (a link, a strong). |
CLI 会复制进你项目的文件。
正在加载源码