Playground: a reader's page
One paragraph annotated the way a reader does it: a circle, two highlighters, a red underline, a struck phrase, a wavy line and margin notes with arrows. Switch each on and off, or replay the whole page being marked up.
One component for every mark, in the spirit of RoughNotation: put a highlight, an underline, a circle, a box, brackets, a strike, a cross-out or a scribble on real words, and draw it on when it scrolls into view.
npx shadcn@latest add @wobko/annotate第一次使用?先把 registry 加进 components.json。 如何安装
One paragraph annotated the way a reader does it: a circle, two highlighters, a red underline, a struck phrase, a wavy line and margin notes with arrows. Switch each on and off, or replay the whole page being marked up.
The eight marks side by side. Each is a real component underneath (Highlight, Underline, Circled, Strike, Scribble) with the same props.
A highlighter takes a tone; every other mark takes a pen. Fine-liner, felt tip or brush.
Turn the review on and the draft is marked up in sequence: words crossed out, a phrase scribbled, another bracketed. Nothing is removed from the text.
Renders the matching mark (Highlight, Underline, Circled, Strike or Scribble) for `type`, so every behavior of those applies: the words stay text, the drawing is aria-hidden and follows line breaks, and `animate` writes it on the first time it scrolls into view.
| 属性 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| type | "highlight" | "underline" | "circle" | "box" | "brackets" | "strike-through" | "crossed-off" | "scribble" | - | Which mark to put on the words. |
| color | HighlightTone | MarkPen | - | For highlight: yellow, pink, green, blue, orange, lilac or teal. For everything else: ink, blue, red, green, pencil, marker or orange. |
| weight | "fine" | "regular" | "brush" | "regular" | Fine-liner, felt tip or brush pen (a highlighter is held light, regular or heavy). |
| kind | "single" | "double" | "wavy" | "scribble" | "single" | The line of an underline. Ignored by the other types. |
| show | boolean | true | Show or hide the mark. With animate, turning it on plays the draw-on again. |
| animate | boolean | false | Hold the mark back and draw it on the first time the words scroll into view. Reduced motion just shows it. |
| delay | number | - | Milliseconds before the drawing starts. |
| seed | string | number | - | Pins the hand. Default: derived from useId(), so server and client draw the same marks. |
CLI 会复制进你项目的文件。
正在加载源码