Captain UI

Accordion

Opening an item lifts it off the page and springs its height open. Click again mid-flight and it reverses from where it is, without a jump.

npx shadcn@latest add https://captain-ui.vercel.app/r/accordion.json

Only if you allow it for that repository. By default an agent opens a pull request and waits; you merge it, or it merges itself once the checks you chose have passed.

The agent stops at the end of its current step, commits what it has to a branch and tells you what is left. A $12.50 cap with four agents in parallel means a worst case of $50.00.

In a fresh sandbox per run, with your repository cloned and nothing else. Secrets come from your vault at run time and are never written to disk or to the log.

Every run works on its own branch, so undoing it is closing the pull request. Runs that touched a database record each migration, and you can roll one back from the run page.

Usage

import { Accordion } from "@/components/ui/accordion"

<Accordion
  type="multiple"
  items={[{ value: "cap", title: "What happens at the spend cap?", content: "The agent stops after its current step." }]}
/>

Props

PropTypeDefaultWhat it does
items{ value: string; title: ReactNode; content: ReactNode; disabled?: boolean }[]The items.
type"single" | "multiple""single"One open at a time, or any number.
valuestring[]Controlled open items.
defaultValuestring[][]Initially open items when uncontrolled.
onValueChange(value: string[]) => voidCalled when an item opens or closes.
collapsiblebooleantrueSingle only: whether the open item can close.

Keyboard

Enter / Space
Open or close
↑ ↓
Previous / next item
Home / End
First / last item

Accessibility

  • Each title is a button inside a heading, with aria-expanded and aria-controls.
  • Each panel is a region labelled by its title, and is inert while closed so its links cannot be tabbed into.
  • Reduced motion drops the spring and the lift; the panel opens at once.