Skip to main content

Accordion

Stacked collapsible sections with an interruptible spring height, a blur fade on the content, and single or multiple open items.

Clicking rapidly mid-transition reverses directly from the live height with momentum, never snapping back to zero.

Customize

Content blur (px)4
Spring speed1

Installation

npx shadcn@latest add @kinetic/accordion

Usage

Compose Accordion, AccordionItem, AccordionTrigger and AccordionContent. Each item needs a unique value.

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

export function Faq() {
  return (
    <Accordion type="single" defaultValue="shipping" collapsible>
      <AccordionItem value="shipping">
        <AccordionTrigger>How long does shipping take?</AccordionTrigger>
        <AccordionContent>Orders ship within two business days.</AccordionContent>
      </AccordionItem>
      <AccordionItem value="returns">
        <AccordionTrigger>Can I return an item?</AccordionTrigger>
        <AccordionContent>Returns are free for 30 days.</AccordionContent>
      </AccordionItem>
    </Accordion>
  );
}

Multiple

Set type="multiple" to let several items stay open. value and defaultValue then take an array of keys.

<Accordion type="multiple" defaultValue={["shipping", "returns"]}>...</Accordion>

Collapsible

In single mode, collapsible (on by default) lets the open item close again. Set it to false to keep one item open at all times.

<Accordion type="single" defaultValue="shipping" collapsible={false}>...</Accordion>

Icon

Choose the indicator with icon: a rotating chevron or a plus that morphs into a minus.

<Accordion type="single" icon="plus">...</Accordion>

Keyboard

Triggers are buttons inside headings. ArrowUp and ArrowDown move between triggers, Home and End jump to the first and last.

Motion preferences

Toggling mid-animation reverses from the current height. Use blurPx and speed to tune the reveal. Reduced motion opens and closes instantly.

API Reference

Accordion

Zero-dependency accordion provider managing single or multiple expanded items, spring speed, content blur, and icon style.

PropTypeDefaultDescription
type"single" | "multiple""single"Allows either one item or multiple items open at once.
value / defaultValue / onValueChangestring | readonly string[]-Controlled or initial expanded item key(s).
collapsiblebooleantrueAllows closing the currently open item in single mode.
icon"chevron" | "plus""chevron"Selects rotating chevron or morphing plus-to-minus indicator.
blurPx / speednumber4 / 1Content blur radius (px) and spring speed multiplier (0.25-4).

Notes

This Radix Accordion requires type='single' or type='multiple'. Do not place interactive buttons or links inside AccordionTrigger since it already renders a button inside an h3 header.