Skip to content
Ballpoint

Accordion

Hand-ruled sections with a drawn chevron that turns over as they open.

From shadcn/ui
Built on Base UI Accordion

Yes. Every component is built on Base UI, checked with axe in both themes, and keyboard-tested. The drawing is decoration; the semantics are the primitive's.

Installation

pnpm dlx shadcn@latest add @ballpoint/accordion

Usage

tsx
import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from "@/components/ui/accordion"

<Accordion>
  <AccordionItem value="a">
    <AccordionTrigger>Is it accessible?</AccordionTrigger>
    <AccordionContent>Yes.</AccordionContent>
  </AccordionItem>
</Accordion>

Examples

Several open

With multiple, items open independently.

Orders leave the studio on Tuesdays and Fridays, wrapped in brown paper.

Cap the pen, keep it out of the sun, and never lend it.

With icons

A glyph in front of each title.

Four to start with, each with a night colour that clears 4.5:1 on every paper.

Open them all

Own the open items to expand and collapse everything at once.

API reference

multiple
default false
boolean

On Accordion: lets more than one item stay open.

defaultValue
string[]

On Accordion: the items open to begin with.

AccordionTrigger header
Accordion.Header props

Reaches the heading row, an h3 by default. Pass { render: <div /> } to keep it out of the page outline.

AccordionTrigger seed
string | number

Pins the chevron's drawing.

Every other prop goes to Base UI's Accordion.