组件

Circled

A hand loop around a word or phrase: a circle that overshoots where it started, a box, or a pair of square brackets. It can be written on as it scrolls into view.

安装

terminal
npx shadcn@latest add @wobko/circled

第一次使用?先把 registry 加进 components.json。 如何安装

示例

Default

A loop around a word. It overshoots where it started, like a hand that did not quite stop.

Shapes and pens

A circle, a box and a pair of brackets; ink, blue, red and a brush pen.

The answer key

Mark the right answer, written on with the pen. The circle is decoration: the answer is also given in words.

A word in a title, and bleed

The loop hugs one line of writing: a short word in a display title keeps clear of the lines above and below. bleed sets how far it stands off.

API 参考

Circled

A <span> (or your own element with asChild) that hosts ONE drawing for the whole phrase, in front of the words. For a phrase that wraps, prefer the box or the brackets.

属性类型默认值说明
shape"circle" | "box" | "brackets""circle"A loop that overshoots, a hand box, or square brackets on both sides.
tone"ink" | "blue" | "red" | "green" | "pencil" | "marker" | "orange""ink"The pen. Red felt is the teacher's circle.
weight"fine" | "regular" | "brush""regular"Fine-liner, felt tip or brush pen.
bleednumber2How many px the mark stands off the writing, on every side (0 to 16). A loop already hugs one line of text, close enough to leave the words either side alone; raise it for a roomier ring, or for a mark that shares a line with a bigger neighbor.
animatebooleanfalseWrite the loop on, following the stroke, the first time it scrolls into view.
showbooleantrueShow or hide the mark. With animate, turning it on plays the draw-on.
delaynumber-Milliseconds to wait before drawing on.
seedstring | number-Pins the hand.
asChildbooleanfalseRender the mark on your own child element.

无障碍

  • The words are ordinary text; the loop is aria-hidden and pointer-events-none, so it never blocks a click on a link or button inside.
  • If the circle carries meaning (the correct answer, the item to check) say so in text as well; a drawing alone is not announced.
  • Until the drawing exists a thin outline shows; in Windows high contrast a real outline is shown instead of the drawing.

源码

CLI 会复制进你项目的文件。

正在加载源码