Questions
Ruled rows on a page. Opening one turns the chevron over, draws a margin brace beside the text (written top to bottom in blue pencil) and lets the words soak in. `type="single" collapsible` opens one at a time and lets you close it again.
Ruled rows that open. Each row sits on a hand-pulled pencil rule; a hovered row gets a highlighter swipe, and an opened row turns its chevron over, writes a margin brace beside its text and lets the words soak in. Radix behavior and keyboard support are untouched.
npx shadcn@latest add @wobko/accordion第一次使用?先把 registry 加进 components.json。 如何安装
Ruled rows on a page. Opening one turns the chevron over, draws a margin brace beside the text (written top to bottom in blue pencil) and lets the words soak in. `type="single" collapsible` opens one at a time and lets you close it again.
`type="multiple"` keeps every row you open. `bracket="square"` swaps the brace for a square bracket, and `bracket={false}` leaves the margin empty. Buttons inside a panel keep their focus rings: an open panel is not clipped.
A controlled accordion in a card: the open row lives in state, a button opens the next one, and the fields inside keep their rings and hover lines.
The shadcn demo: one row open at a time, the first open on arrival, and panels that hold more than one paragraph. Give AccordionContent a flex column and `text-balance` and the paragraphs space themselves.
The Radix Accordion root.
| 属性 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| type | "single" | "multiple" | - | One open row at a time, or as many as you like. |
| collapsible | boolean | false | Single mode only: allow the open row to be closed again. |
| value / defaultValue / onValueChange | string | string[] | - | Controlled and uncontrolled state (an array in multiple mode). |
| bracket | "curly" | "square" | false | "curly" | The mark drawn in the margin of an opened row. |
| disabled / dir / orientation | boolean / "ltr" | "rtl" / "vertical" | "horizontal" | - | As Radix. |
A row: `relative`, with a drawn rule at its foot (not on the last row). Its `value` ties trigger and content together.
| 属性 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| value | string | - | Identifies the row. |
| disabled | boolean | false | The trigger is skipped by the arrow keys and cannot be opened. |
The row's button, inside the Radix header (an h3). Bold hand text, a chevron doodle that turns over when open, a highlighter swipe wiped in on hover and a blue ring on keyboard focus. It is 8 px wider than its text on each side so the swipe has room, and pulled back by the same amount.
| 属性 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| seed | string | number | - | Pins the hand. Default: derived from useId(). |
CLI 会复制进你项目的文件。
正在加载源码