Components

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.

Install

terminal
npx shadcn@latest add @wobko/bracket

First time here? Add the registry to components.json first. How to install

Examples

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 reference

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.

PropTypeDefaultDescription
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.

Accessibility

  • 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.

Source

The files the CLI copies into your project.

Loading the source