Skip to main content
You are viewing Pre-Alpha documentation.
Vuetify0 Logo
Theme
Mode
Accessibility
Vuetify

ExpansionPanel

A component for creating accordion-style expansion panels with proper ARIA support.


Renders elementIntermediate100% coverageJan 27, 2026

Usage

The ExpansionPanel component provides a wrapper and item pattern for managing expansion state in accordion-style interfaces. It uses the createSelection composable internally and provides full v-model support with automatic state synchronization.

Expanded:

<script setup lang="ts">
  import { ExpansionPanel } from '@vuetify/v0'
  import { shallowRef } from 'vue'

  const panels = [
    { id: 'panel-1', title: 'Panel 1', content: 'This is the content for panel 1.' },
    { id: 'panel-2', title: 'Panel 2', content: 'This is the content for panel 2.' },
    { id: 'panel-3', title: 'Panel 3', content: 'This is the content for panel 3.' },
  ]

  const model = shallowRef<string[]>([])
</script>

<template>
  <ExpansionPanel.Root
    v-model="model"
    class="border border-divider rounded-lg border-solid overflow-hidden divide-y divide-divider"
    multiple
  >
    <ExpansionPanel.Item
      v-for="item in panels"
      :key="item.id"
      :value="item.id"
    >
      <ExpansionPanel.Activator
        v-slot="{ isSelected }"
        class="w-full px-3 py-2 border-none flex items-center gap-3 text-left cursor-pointer bg-surface hover:bg-surface-tint"
      >
        <span
          class="inline-flex items-center justify-center w-5 text-sm text-on-surface opacity-60"
          :class="isSelected ? 'text-primary' : undefined"
        >
          {{ isSelected ? '−' : '+' }}
        </span>
        <span class="flex-1 font-medium text-on-surface text-base">{{ item.title }}</span>
      </ExpansionPanel.Activator>

      <ExpansionPanel.Content class="p-4">
        {{ item.content }}
      </ExpansionPanel.Content>
    </ExpansionPanel.Item>
  </ExpansionPanel.Root>

  <p class="mt-4 text-sm text-on-surface opacity-60">
    Expanded: {{ model.join(', ') }}
  </p>
</template>

Anatomy

Anatomy
<script setup lang="ts">
  import { ExpansionPanel } from '@vuetify/v0'
</script>

<template>
  <ExpansionPanel.Root>
    <ExpansionPanel.Item>
      <ExpansionPanel.Activator />

      <ExpansionPanel.Content />
    </ExpansionPanel.Item>
  </ExpansionPanel.Root>
</template>

For instances where you need to wrap the activator in a heading element (h3) for semantic purposes and WAI-ARIA, use the ExpansionPanel.Header component:

AnatomyWithHeader
<script setup lang="ts">
  import { ExpansionPanel } from '@vuetify/v0'
</script>

<template>
  <ExpansionPanel.Root>
    <ExpansionPanel.Item>
      <ExpansionPanel.Header>
        <ExpansionPanel.Activator />
      </ExpansionPanel.Header>

      <ExpansionPanel.Content />
    </ExpansionPanel.Item>
  </ExpansionPanel.Root>
</template>

API Reference

The following API details are for all variations of the ExpansionPanel component.

ExpansionPanel.Root

Props

namespace

string

Namespace for dependency injection (default: 'v0:expansion-panel')

Default: "v0:expansion-panel"

disabled

boolean

Disables the entire expansion panel instance and all items

Default: false

enroll

boolean

Auto-expand non-disabled items when registered

Default: false

mandatory

boolean | "force"

Mandatory expansion behavior: - false (default): All panels can be collapsed - true: Prevents collapsing the last expanded panel - 'force': Automatically expands the first non-disabled panel

Default: false

multiple

boolean

Enable multi-expansion mode - false (default): Single panel expanded at a time (accordion mode) - true: Multiple panels can be expanded simultaneously Note: Changes v-model type from T to T[]

Default: false

modelValue

T | T[]

Events

Slots

default

ExpansionPanelRootSlotProps

ExpansionPanel.Activator

Props

namespace

string

Default: "v0:expansion-panel"

Slots

default

ExpansionPanelActivatorSlotProps

ExpansionPanel.Content

Props

namespace

string

Default: "v0:expansion-panel"

Slots

default

ExpansionPanelContentSlotProps

ExpansionPanel.Header

Props

namespace

string

Namespace for retrieving the parent ExpansionPanelItem context (default: 'v0:expansion-panel')

Default: "v0:expansion-panel"

Slots

default

ExpansionPanelHeaderSlotProps

ExpansionPanel.Item

Props

id

string

Unique identifier for the panel item (auto-generated if not provided)

value

V

Value associated with this panel item for v-model binding

disabled

MaybeRef<boolean>

Disables this specific panel item

namespace

string

Namespace to retrieve the parent ExpansionPanelRoot context (default: 'v0:expansion-panel')

Default: "v0:expansion-panel"

Slots

default

ExpansionPanelItemSlotProps
Was this page helpful?

© 2016-1970 Vuetify, LLC
Ctrl+/