Default
A straight arrow in its 80 x 40 box. The tail sits a hair lower than the head, like a real one.
A hand-drawn arrow that points where you tell it: one of eight directions inside its own box, or straight at another element on the page. Straight, curved, or with a loop-the-loop, five heads, and an optional label.
npx shadcn@latest add @wobko/arrow第一次使用?先把 registry 加进 components.json。 如何安装
A straight arrow in its 80 x 40 box. The tail sits a hair lower than the head, like a real one.
Eight directions, each straight and curved; then the curl and the five heads.
Give it a ref (or a selector) and the arrow leaves its small box and stops just short of the target, wherever the layout puts it. Resize the window and it follows.
Text inside an Arrow is its label: real handwritten text, placed outside the tail on the side the arrow leaves from. Here it leaves the note at the top right and lands on the signature line.
A <span> that fills its box (`className` sizes it, default 80 x 40) with the drawing. Text inside becomes a label, real text placed outside the tail. The svg is aria-hidden and never takes a click.
| 属性 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| direction | "right" | "left" | "up" | "down" | "up-right" | "up-left" | "down-right" | "down-left" | "right" | Which way it points, inside its own box. |
| curve | "straight" | "curved" | "curl" | "straight" | A straight shaft, one lazy arc, or an arc with a loop-the-loop. |
| head | "v" | "two" | "open" | "solid" | "none" | "v" | The arrowhead: two strokes joined, two loose strokes, an open V, a filled triangle, or none. |
| tone | "ink" | "blue" | "red" | "green" | "pencil" | "marker" | "orange" | "ink" | The pen. Blue felt is the reserved "you" ink. |
| weight | "fine" | "regular" | "brush" | "regular" | Fine-liner, felt tip or brush. |
| bend | "up" | "down" | "up" | Which way a curved shaft bulges: toward the top (the left for a vertical arrow) or the bottom (the right). |
| pointAt | RefObject<Element> | Element | string | - | Aim at another element (a ref, an element or a CSS selector). The arrow leaves the middle of its own box and stops `gap` px short of the target, wherever that is; it follows layout changes. |
| gap | number | 6 | With pointAt, how far short of the target the head stops, px. |
| mirror | boolean | true | Flip horizontal directions in a right-to-left page, so "next" keeps meaning onwards. |
| animate | boolean | false | Draw the arrow on, shaft first, the first time it scrolls into view. |
| show | boolean | true | Show or hide it. |
| delay | number | - | Milliseconds before the drawing starts. |
| seed | string | number | - | Pins the hand. |
CLI 会复制进你项目的文件。
正在加载源码