docs/components/navigation/Accordion

Accordion

Collapsible section group.

import { Accordion } from '@ybouhjira/hyperkit';

#Playground

Edit the code — the preview recompiles and re-renders as you type.

Live playground
Loading preview…

#Props

PropTypeDefaultDescription
items *AccordionItemData[]Array of accordion items
type'single' | 'multiple''single'Whether multiple items can be expanded simultaneously
defaultValuestring | string[]Default expanded item(s) For 'single' type: string For 'multiple' type: string[]
collapsiblebooleantrueWhether all items can be collapsed (only for single mode)
disabledbooleanfalseDisable all accordion items
classstringAdditional CSS classes
styleJSX.CSSPropertiesCustom styles
unstyledbooleanRemove sk-* styling classes

* required prop.

#Design Tokens

This component reads the following CSS custom properties. Override them globally or per-instance to restyle it — see the CSS Variables guide.

  • --sk-accent
  • --sk-accordion-bg
  • --sk-accordion-border
  • --sk-accordion-content-padding
  • --sk-accordion-trigger-hover-bg
  • --sk-accordion-trigger-padding
  • --sk-bg-secondary
  • --sk-border
  • --sk-font-size-base
  • --sk-space-md
  • --sk-space-sm
  • --sk-text-muted
  • --sk-text-primary