Skip to content
ChibiUI

Built on Radix UI Accordion

Accordion

Vertically stacked, collapsible sections. Heights animate smoothly, and the icon either rotates or twitches its ears.

Playground

Yes, every primitive is built on Radix UI and tested with axe-core.

Generated code
<ChibiAccordion type="single" collapsible>
  <ChibiAccordionItem value="item-0">
    <ChibiAccordionTrigger icon="ears">
      Is it accessible?
    </ChibiAccordionTrigger>
    <ChibiAccordionContent>Yes, every primitive is built on Radix UI and tested with axe-core.</ChibiAccordionContent>
  </ChibiAccordionItem>
  <ChibiAccordionItem value="item-1">
    <ChibiAccordionTrigger icon="ears">
      Can I theme it?
    </ChibiAccordionTrigger>
    <ChibiAccordionContent>All colours are CSS variables, scoped per subtree with data-chibi-theme.</ChibiAccordionContent>
  </ChibiAccordionItem>
</ChibiAccordion>

Import

TSX
import {
  ChibiAccordion,
  ChibiAccordionItem,
  ChibiAccordionTrigger,
  ChibiAccordionContent,
} from '@chibi-ui/react/accordion';

Examples

Multiple open sections
<ChibiAccordion type="multiple" defaultValue={['shipping']}>
  <ChibiAccordionItem value="shipping">
    <ChibiAccordionTrigger headingLevel={2}>Shipping</ChibiAccordionTrigger>
    <ChibiAccordionContent>Free over ¥3000.</ChibiAccordionContent>
  </ChibiAccordionItem>
  <ChibiAccordionItem value="returns">
    <ChibiAccordionTrigger headingLevel={2}>Returns</ChibiAccordionTrigger>
    <ChibiAccordionContent>Within 30 days.</ChibiAccordionContent>
  </ChibiAccordionItem>
</ChibiAccordion>

Accessibility

  • Each trigger is a button with aria-expanded inside a heading. Set the heading level with headingLevel.
  • Arrow keys, Home and End move between triggers.
  • Panels are regions labelled by their trigger.
  • The height animation uses CSS keyframes driven by the measured content height, and is removed under reduced motion.

API reference

ChibiAccordion

PropTypeDefaultDescription
type'single' | 'multiple'—One or many open items.
collapsibleboolean—Allow closing the open item (type='single').
value / defaultValuestring | string[]—Controlled / uncontrolled value.

ChibiAccordionTrigger

PropTypeDefaultDescription
headingLevel2 | 3 | 4 | 5 | 63Wrapping heading level.
icon'chevron' | 'ears''chevron'Indicator style.