Components

Accordion

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.

Install

terminal
npx shadcn@latest add @wobko/accordion

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

Examples

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.

Several open, square bracket

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

Account settings

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.

Product details (long panels)

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.

API reference

Accordion

The Radix Accordion root.

PropTypeDefaultDescription
type"single" | "multiple"-One open row at a time, or as many as you like.
collapsiblebooleanfalseSingle mode only: allow the open row to be closed again.
value / defaultValue / onValueChangestring | 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 / orientationboolean / "ltr" | "rtl" / "vertical" | "horizontal"-As Radix.

AccordionItem

A row: `relative`, with a drawn rule at its foot (not on the last row). Its `value` ties trigger and content together.

PropTypeDefaultDescription
valuestring-Identifies the row.
disabledbooleanfalseThe trigger is skipped by the arrow keys and cannot be opened.

AccordionTrigger

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.

PropTypeDefaultDescription
seedstring | number-Pins the hand. Default: derived from useId().

Accessibility

  • The WAI-ARIA accordion pattern from Radix: each trigger is a button with `aria-expanded` and `aria-controls` inside a heading; Enter and Space toggle; ArrowDown, ArrowUp, Home and End move between triggers.
  • The panel is a `region` labeled by its trigger. Closed panels are removed from the accessibility tree.
  • The chevron, the rules, the swipe and the brace are aria-hidden and pointer-events: none. State is told by aria-expanded and the turned chevron, not by color.
  • Keyboard focus draws a blue felt ring round the row; hover-only decoration never carries meaning. Windows high contrast hides the drawings and uses the browser's own focus ring.
  • Reduced motion (the OS setting or data-motion="reduced") opens rows at once and shows the brace finished.
  • Right-to-left layouts mirror the brace and text indent; the chevron is symmetric.

Source

The files the CLI copies into your project.

Loading the source