Accordion

Usage

Yes. It adheres to the WAI-ARIA design pattern.

::d-accordion{default-value="first-item" collapsible}
  ::d-accordion-item{value="first-item"}
  #title
  Is it accessible?

  #content
  Yes. It adheres to the WAI-ARIA design pattern.
  ::

  ::d-accordion-item
  #title
  Is it unstyled?

  #content
  Yes. It's unstyled by default, giving you freedom over the look and feel.
  ::
  :d-accordion-item{title="Can it be animated?" content="Yes! You can use the transition prop to configure the animation."}
::

The value prop in ::d-accordion-item is auto-generated by default. You can set them to other unique values and put them in the default-value prop of ::d-accordion.

Props

::d-accordion-item

type'single' | 'multiple'
'single'
collapsibleboolean
undefined
Whether the items can be collapsed
defaultValuestring | string[]
Default open item

::d-accordion

valuestring
Item value
titlestring
Item title
contentstring
Item content