---
title: "Accordion"
canonical_url: "https://lab.nnsvn.me/docs/components/page/accordion"
---

> Index of every page on this site: [llms.txt](https://lab.nnsvn.me/llms.txt)

## Usage

<ct-stack>
<div className="p-4">
<ct-accordion :collapsible="true" default-value="first-item">
<ct-accordion-item value="first-item">
<template v-slot:title="">

Is it accessible?

</template>

<template v-slot:content="">

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

</template>
</ct-accordion-item>

<ct-accordion-item>
<template v-slot:title="">

Is it unstyled?

</template>

<template v-slot:content="">

Yes. It's unstyled by default, giving you freedom over the look and feel.

</template>
</ct-accordion-item>

<ct-accordion-item content="Yes! You can use the transition prop to configure the animation." title="Can it be animated?">



</ct-accordion-item>
</ct-accordion>
</div>

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

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

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

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

</ct-stack>

```text
::

The `value` prop in `::ct-accordion-item`{lang="mdc"} is auto-generated by default. You can set them to other _unique_ values and put them in the `default-value` prop of `::ct-accordion`{lang="mdc"}.

## Props

#### `::ct-accordion-item`{lang="mdc"}

::ct-field-group
:ct-field{name="type" type="'single' | 'multiple'" default-value="'single'"}
:ct-field{name="collapsible" type="boolean" default-value="undefined"}[Whether the items can be collapsed]
:ct-field{name="defaultValue" type="string | string[]"}[Default open item]
::

#### `::ct-accordion`{lang="mdc"}

::ct-field-group
:ct-field{name="value" type="string"}[Item value]
:ct-field{name="title" type="string"}[Item title]
:ct-field{name="content" type="string"}[Item content]
::
```

## Sitemap

See the full [sitemap](https://lab.nnsvn.me/sitemap.md) for all pages.
