CSC Design System next
VueFlavour Vue React Angular TypeScript PrimaryCSC UI ColorsPrimarySecondaryAccentCustom ColorsRedOrangeGreenBluePurplePink
Guides Getting started Customization Data visualization Migration guide Componentsc-accordionc-alertc-autocompletec-badgec-buttonc-button-groupc-cardc-checkboxc-csc-logoc-data-tablec-dividerc-iconc-icon-buttonc-inputc-linkc-listc-loaderc-login-buttonsc-login-cardc-mainc-menuc-messagec-modalc-navigation-buttonc-otp-inputc-pagec-paginationc-popoverc-progress-barc-progress-circlec-radio-groupc-selectc-side-navigationc-sliderc-spinnerc-statusc-stepsc-switchc-tablec-tabsc-tagsc-text-fieldc-toastsc-toolbarc-tooltip

<c-accordion>

Examples

Basic
Vue React Angular TypeScript
<template>
  <c-accordion v-model="expanded">
    <c-accordion-item heading="Project billing" value="billing">
      <p>Billing units are deducted monthly based on the resources in use.</p>
    </c-accordion-item>

    <c-accordion-item heading="Members and roles" value="members">
      <p>Invite members by email and assign them a role in the project.</p>
    </c-accordion-item>

    <c-accordion-item heading="Data storage" value="storage">
      <p>Allas object storage is available to every project by default.</p>
    </c-accordion-item>
  </c-accordion>
</template>

<script setup lang="ts">
import { ref } from 'vue';

const expanded = ref<'billing' | 'members' | 'storage'>('billing');
</script>
Custom style
Vue React Angular TypeScript
<template>
  <c-accordion v-model="expanded" class="custom-style">
    <c-accordion-item heading="Project billing" value="billing">
      <p>Billing units are deducted monthly based on the resources in use.</p>
    </c-accordion-item>

    <c-accordion-item heading="Members and roles" value="members">
      <p>Invite members by email and assign them a role in the project.</p>
    </c-accordion-item>

    <c-accordion-item heading="Data storage" value="storage">
      <p>Allas object storage is available to every project by default.</p>
    </c-accordion-item>
  </c-accordion>
</template>

<script setup lang="ts">
import { ref } from 'vue';

const expanded = ref<'billing' | 'members' | 'storage'>('billing');
</script>

<style>
:root,
:root[data-theme='light'] {
  --accordion-content-background: var(--c-surface);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --accordion-content-background: color-mix(
      in srgb,
      var(--c-primary) 20%,
      transparent
    );
  }
}

:root[data-theme='dark'] {
  --accordion-content-background: color-mix(
    in srgb,
    var(--c-primary) 20%,
    transparent
  );
}

c-accordion.custom-style {
  c-accordion-item {
    &::part(root) {
      border: 1px solid var(--c-border);
    }

    &::part(header) {
      background-color: transparent;
    }

    &::part(content) {
      margin: 8px;
      padding: 8px;
      border-radius: 4px;
      background-color: var(--accordion-content-background);
    }

    &[expanded]::part(root) {
      border-color: var(--c-primary);
      background-color: color-mix(in srgb, var(--c-primary) 10%, transparent);
    }
  }
}
</style>
Multiple
Vue React Angular TypeScript
<template>
  <div>
    <c-accordion multiple outlined>
      <c-accordion-item heading="Project billing" value="billing">
        <p>Billing units are deducted monthly based on the resources in use.</p>
      </c-accordion-item>

      <c-accordion-item heading="Members and roles" value="members">
        <p>Invite members by email and assign them a role in the project.</p>
      </c-accordion-item>

      <c-accordion-item heading="Data storage" value="storage">
        <p>Allas object storage is available to every project by default.</p>
      </c-accordion-item>
    </c-accordion>
  </div>
</template>
Basic · c-accordion-item
Vue React Angular TypeScript
<template>
  <div>
    <c-accordion>
      <c-accordion-item heading="Project billing" value="billing">
        <c-icon slot="icon" :path="mdiCreditCardOutline" />

        <p>Billing units are deducted monthly based on the resources in use.</p>
      </c-accordion-item>

      <c-accordion-item heading="Members and roles" value="members">
        <c-icon slot="icon" :path="mdiAccountGroup" />

        <p>Invite members by email and assign them a role in the project.</p>
      </c-accordion-item>

      <c-accordion-item heading="Data storage" value="storage">
        <c-icon slot="icon" :path="mdiDatabase" />

        <p>Allas object storage is available to every project by default.</p>
      </c-accordion-item>
    </c-accordion>
  </div>
</template>

<script setup lang="ts">
import { mdiAccountGroup, mdiCreditCardOutline, mdiDatabase } from '@mdi/js';
</script>
Custom header · c-accordion-item
Vue React Angular TypeScript
<template>
  <div>
    <c-accordion>
      <c-accordion-item value="members">
        <div slot="header" class="member-header">
          <span>Members and roles</span>

          <span class="member-header-meta">3 pending invites</span>
        </div>

        <p>Invite members by email and assign them a role in the project.</p>
      </c-accordion-item>

      <c-accordion-item heading="Data storage" value="storage">
        <p>Allas object storage is available to every project by default.</p>
      </c-accordion-item>
    </c-accordion>
  </div>
</template>

<style>
/* Slotted header content is light DOM: style it with your own CSS. It
   inherits the header's text color, so it matches a plain `heading`. */
.member-header {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-weight: 500;
}

.member-header-meta {
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--c-on-surface-muted);
}
</style>

API reference

<c-accordion>

Properties

PropertyAttributeTypeDefaultDescription
mandatorymandatorybooleanfalseDisallow collapsing all the items
multiplemultiplebooleanfalseAllow expanding multiple items
outlinedoutlinedbooleanfalseShow an outline around expanded items
valueAccordionValuenullValue of the accordion

Events

EventDetailDescription
changeAccordionValueFired when the expansion state changes, carrying the new value as a bare `detail`: the expanded item's value, an array of values in `multiple` mode, or `null` when everything is collapsed.
changeValueAccordionValueLegacy value-change event carrying the new expansion value (kept for existing `@changeValue` listeners and the `v-control` directive). Also dispatched as `change-value` — bind that name in Vue templates.
inputvoidNative bubbling input event dispatched alongside `changeValue` so a plain `v-model` works without `v-control`; carries no detail.
update:valueAccordionValueFired with the new expansion value whenever an item is toggled — the `v-model` contract.

Slots

SlotDescription
defaultDefault slot for the c-accordion-item components

CSS parts

Style from outside with c-accordion::part(name) — parts are the library's only styling customization API.

PartDescription
rootThe outer wrapper stacking the accordion items vertically

<c-accordion-item>

Properties

PropertyAttributeTypeDefaultDescription
collapsablecollapsablebooleanfalseMarks the item as collapsable
expandedexpandedbooleanfalseExpansion status of the item
headingheadingstring''Heading of the accordion item
outlinedoutlinedbooleanfalseShow an outline around the expanded item
valuevaluenumber | stringValue of the accordion item

Events

EventDetailDescription
item-change{ expanded: boolean; value: number | string | undefined }Fired when the header is toggled, carrying the requested expansion state and the item's `value`; bubbles so the parent `<c-accordion>` can update its model.

Slots

SlotDescription
headerCustom header slot
iconIcon shown in the header before the heading
defaultDefault slot

CSS parts

Style from outside with c-accordion-item::part(name) — parts are the library's only styling customization API.

PartDescription
rootThe outer wrapper of the item, carries the rounding and the outline when outlined
headerThe toggle button row containing the icon, heading and indicator
indicatorThe rotating chevron at the end of the header
contentThe padded wrapper around the slotted content inside the collapsing region