Display

Collapsible

A single disclosure: a trigger that shows or hides a block of content beneath it. For a group of them that coordinate, use Accordion.

Unlimited projects, up to three team members, and community support. Upgrade any time | nothing is lost when you do.

Copy
<script setup lang="ts">
const open = ref(false)
</script>

<template>
  <JCollapsible v-model="open" label="What’s included in the free plan?" class="w-80">
    <p>
      Unlimited projects, up to three team members, and community support. Upgrade any time | nothing is lost when you do.
    </p>
  </JCollapsible>
</template>

Installation #

With the Nuxt module, every component is auto-imported — there is nothing to add. In a plain Vue project, import what you use:

Copy
import { JCollapsible } from '@juxtui/ui'

Usage #

Copy
<JCollapsible v-model="open" label="What’s included in the free plan?">
  <p>Unlimited projects, up to three team members, and community support.</p>
</JCollapsible>

A single disclosure primitive — for a group where opening one can close the others, use JAccordion instead.

Variants & examples #

Several, independently#

Each panel keeps its own v-model, so any number can be open at once.

Yes, at any time. Upgrades apply immediately; downgrades apply at the next billing cycle.

Within 14 days of any charge, no questions asked.

Every paid plan starts with a 14-day trial | no card required.

Disabled#

Upgrade to a Team plan to unlock advanced settings.

Copy
<script setup lang="ts">
const open = ref(false)
</script>

<template>
  <JCollapsible v-model="open" label="Advanced settings (unavailable on your plan)" disabled class="w-80">
    <p>Upgrade to a Team plan to unlock advanced settings.</p>
  </JCollapsible>
</template>

API #

Props

PropTypeDefault Description
modelValuebooleanfalseBound with v-model.
labelstring—Visible summary text; use the trigger slot for custom content instead.
disabledbooleanfalseDisables the trigger.

Events

EventPayload Description
update:modelValuebooleanEmitted when toggled.

Slots

SlotProps Description
default—Panel content.
trigger—Custom trigger content, replacing label.

Accessibility #

  • A native <button type="button"> with aria-expanded and aria-controls pointing at the panel.
  • The panel is role="region", labelled by the trigger, and marked inert while closed — its contents are unreachable and unannounced.
  • Panel height animates through CSS grid rows rather than a measured pixel value, and is skipped entirely under reduced motion.

Keyboard #

Key Action
EnterToggles the panel.
SpaceToggles the panel.