Skip to content

Collapsible

A standalone show/hide primitive for a single block of content, with the same smooth height animation as Accordion. Use it for things like "Show more details" or a single toggleable section outside of a grouped list.

Examples

Default (uncontrolled)

Uses defaultOpen and manages its own state internally.

Tailwind v4
vue
<Collapsible :default-open="true">
  <template #trigger="{ open, toggle }">
    <button type="button" @click="toggle">
      {{ open ? 'Hide' : 'Show' }} details
    </button>
  </template>
  This is the collapsible content.
</Collapsible>

Default trigger slot

If no trigger slot is provided, a simple "Toggle" button with a chevron is rendered.

Tailwind v4
vue
<Collapsible>
  More information appears here once expanded.
</Collapsible>

Controlled (v-model:open)

Tailwind v4
vue
<script setup>
import { ref } from 'vue'
const open = ref(false)
</script>

<template>
  <Collapsible v-model="open">
    <template #trigger="{ open, toggle }">
      <button @click="toggle">{{ open ? 'Collapse' : 'Expand' }}</button>
    </template>
    Controlled content driven by a parent-owned v-model value.
  </Collapsible>
</template>

Disabled

Tailwind v4
vue
<Collapsible :disabled="true">
  This content cannot be toggled.
</Collapsible>

Props

PropTypeDefaultDescription
modelValuebooleanundefinedControlled open state. When provided, the component becomes controlled and defaultOpen is ignored. Pair with v-model:open (or v-model via the modelValue/update:modelValue convention).
defaultOpenbooleanfalseInitial open state for uncontrolled usage (only used when modelValue is not provided).
disabledbooleanfalsePrevents toggling and dims the default trigger.

Slots

SlotPropsDescription
trigger{ open, toggle }The clickable header/label. Falls back to a default "Toggle" button with a chevron icon if not provided.
defaultThe collapsible content region.

Private — Jetpack Labs internal use only