组件

Bracket

A hand bracket down one side of a block: these paragraphs, this list, these three rows belong together. Square, curly or round, on either side, and it flips with the page direction.

安装

terminal
npx shadcn@latest add @wobko/bracket

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

示例

Default

A square bracket down the start side of two paragraphs.

Kinds and sides

Square, curly and round; on the start side and the end side; in ink, blue and red.

Grouping list items

A curly brace across three items with a note on the other side: the list is still a list.

API 参考

Bracket

A <div> that wraps the block and draws the bracket in its own inline padding (`ps-7` / `pe-7`) as an aria-hidden svg. The content is untouched.

属性类型默认值说明
kind"square" | "curly" | "round""square"A square bracket, a curly brace, or a round parenthesis.
side"start" | "end""start"Which side of the block. Logical: start is the right side in a right-to-left page.
tone"ink" | "blue" | "red" | "green" | "pencil" | "marker" | "orange""ink"The pen.
weight"fine" | "regular" | "brush""regular"Fine-liner, felt tip or brush.
insetnumber8How far the spine of the bracket is from the block's edge, px.
animatebooleanfalseDraw the bracket on, top to bottom, the first time the block scrolls into view.
showbooleantrueShow or hide it.
delaynumber-Milliseconds before the drawing starts.
seedstring | number-Pins the hand.

无障碍

  • Decorative: the bracket is aria-hidden and pointer-events-none. If grouping matters to everyone, group in the markup as well (a list, a <section>, a fieldset).
  • It lives in the block's padding, so text never runs under it; change the padding with className if you move the spine (`inset`).
  • Windows high contrast hides the drawing like every overlay ink.

源码

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

正在加载源码