Skip to main content
You are viewing Pre-Alpha documentation.
Vuetify0 LogoVuetify0 Logo
Theme
Mode
Palettes
Accessibility
Vuetify One
Sign in to Vuetify One

Access premium tools across the Vuetify ecosystem — Bin, Play, Studio, and more.

Not a subscriber? See what's included

Collapsible

A single-item disclosure toggle for showing and hiding content.


Renders elementIntermediateApr 2, 2026

Usage

The Collapsible component provides a simple open/closed toggle for a single content region. It supports v-model for controlled state and exposes data-state attributes for CSS-driven styling.

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

<template>
  <Collapsible.Root
    class="border border-divider rounded-lg border-solid overflow-hidden"
  >
    <Collapsible.Activator
      class="w-full px-3 py-2 border-none flex items-center gap-3 text-left cursor-pointer bg-surface hover:bg-surface-tint"
    >
      <Collapsible.Cue class="inline-flex items-center justify-center w-5 text-sm text-on-surface opacity-60 data-[state=open]:text-primary">
        <span class="data-[state=open]:hidden">+</span>
        <span class="hidden data-[state=open]:inline">&minus;</span>
      </Collapsible.Cue>

      <span class="flex-1 font-medium text-on-surface text-base">
        Toggle content
      </span>
    </Collapsible.Activator>

    <Collapsible.Content class="px-3 py-2 border-t border-divider border-solid">
      <div class="text-on-surface text-sm">
        This content can be toggled open and closed. The Collapsible component manages a single boolean state with full keyboard and accessibility support.
      </div>
    </Collapsible.Content>
  </Collapsible.Root>
</template>

Anatomy

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

<template>
  <Collapsible.Root>
    <Collapsible.Activator>
      <Collapsible.Cue />
    </Collapsible.Activator>

    <Collapsible.Content />
  </Collapsible.Root>
</template>

Examples

Controlled

Use v-model to control the open state externally. The disabled prop prevents interaction.

State: closed
<script setup lang="ts">
  import { Collapsible } from '@vuetify/v0'
  import { shallowRef } from 'vue'

  const open = shallowRef(false)
  const disabled = shallowRef(false)
</script>

<template>
  <div class="flex flex-col gap-4">
    <div class="flex items-center gap-2 flex-wrap">
      <button
        class="px-3 py-1.5 text-sm rounded-lg border border-divider hover:bg-surface-tint"
        @click="open = true"
      >
        Open
      </button>

      <button
        class="px-3 py-1.5 text-sm rounded-lg border border-divider hover:bg-surface-tint"
        @click="open = false"
      >
        Close
      </button>

      <button
        class="px-3 py-1.5 text-sm rounded-lg border border-divider hover:bg-surface-tint"
        @click="open = !open"
      >
        Toggle
      </button>

      <label class="flex items-center gap-1.5 text-sm text-on-surface-variant ml-auto">
        <input v-model="disabled" type="checkbox">
        Disabled
      </label>
    </div>

    <Collapsible.Root
      v-model="open"
      class="border border-divider rounded-lg border-solid overflow-hidden data-[disabled]:opacity-50"
      :disabled
    >
      <Collapsible.Activator
        class="w-full px-3 py-2 border-none flex items-center gap-3 text-left cursor-pointer bg-surface hover:bg-surface-tint data-[disabled]:cursor-not-allowed"
      >
        <Collapsible.Cue class="inline-flex items-center justify-center w-5 text-sm text-on-surface opacity-60 data-[state=open]:text-primary">
          <span class="data-[state=open]:hidden">+</span>
          <span class="hidden data-[state=open]:inline">&minus;</span>
        </Collapsible.Cue>

        <span class="flex-1 font-medium text-on-surface text-base">
          Controlled collapsible
        </span>
      </Collapsible.Activator>

      <Collapsible.Content class="px-3 py-2 border-t border-divider border-solid">
        <div class="text-on-surface text-sm">
          This collapsible is controlled externally via <code class="text-primary">v-model</code>. The buttons above change state from outside the component.
        </div>
      </Collapsible.Content>
    </Collapsible.Root>

    <div class="text-sm text-on-surface-variant">
      State: <code class="text-primary">{{ open ? 'open' : 'closed' }}</code>
    </div>
  </div>
</template>

FAQ

Build a reusable FAQ component by wrapping Collapsible in a custom FaqItem component. Each item is an independent Collapsible instance — they don’t coordinate with each other.

FileRole
FaqItem.vueReusable wrapper around Collapsible with chevron rotation
faq.vueEntry point rendering items from data

Collapsible vs ExpansionPanel

Both components handle expanding and collapsing content, but they solve different problems:

CollapsibleExpansionPanel
ItemsSingleMultiple
StateBoolean (open / closed)Selection set (IDs)
CoordinationNone — each instance is independentShared — accordion mode, mandatory, enroll
v-modelv-model (boolean)v-model (ID or ID[])
Built oncreateSinglecreateSelection

Use Collapsible when you have a single region to show/hide — a details section, a settings panel, a mobile navigation drawer. Each Collapsible is independent.

Use ExpansionPanel when you have a list of items where expanding one may collapse another — an FAQ, a settings page with sections, an accordion sidebar.

Tip

You can build an FAQ from multiple independent Collapsible instances (see the FAQ example above), but if you need “only one open at a time” behavior, use ExpansionPanel instead — it handles that coordination for you.

Accessibility

Collapsible follows the WAI-ARIA Disclosure pattern↗.

Keyboard

KeyAction
EnterToggles the content
SpaceToggles the content

ARIA

AttributeElementValue
aria-expandedActivatortrue when open, false when closed
aria-controlsActivatorPoints to the content element’s id
role="region"ContentLandmarks the content area
aria-labelledbyContentPoints back to the activator’s id

Data attributes

All three sub-components expose data-state="open" or data-state="closed" for CSS-driven styling without JavaScript. The Root and Activator also expose data-disabled when the disabled prop is set.

API Reference

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

Collapsible.Root

Props

namespace

string | undefined

Namespace for dependency injection

Default: "v0:collapsible"

disabled

boolean | undefined

Whether the collapsible is disabled

Default: false

modelValue

boolean | undefined

Default: false

Events

update:model-value

[value: boolean]

Slots

default

CollapsibleRootSlotProps

Collapsible.Activator

Props

namespace

string | undefined

Default: "v0:collapsible"

Slots

default

CollapsibleActivatorSlotProps

Collapsible.Content

Props

namespace

string | undefined

Default: "v0:collapsible"

Slots

default

CollapsibleContentSlotProps

Collapsible.Cue

Props

namespace

string | undefined

Default: "v0:collapsible"

Slots

default

CollapsibleCueSlotProps
Was this page helpful?

© 2016-1970 Vuetify, LLC
Ctrl+/