GhostAccordion reference
Package: @ghostvue/themes. Status: experimental (stability policy).
Themed wrappers for GhostAccordion compound parts; imports default stacked disclosure styles. Root and item add data-themed so headless accordions stay unstyled.
Generated from the component manifest. Edit the manifest or Vue source, then rebuild the docs.
Props
None declared.
Emits
None declared.
Models
None declared.
Slots
| Name | Description |
|---|---|
default | Container content. |
Slot props: default
None declared.
Exposed members
| Name | Type | Description |
|---|---|---|
element | HTMLElement | null | Root element after mount; null before mount. |
Parts and data attributes
| Attribute | Value | Description |
|---|---|---|
data-part | root | Neutral content container. |
CSS variables
| Name | Description |
|---|---|
--ghost-surface-fg | Inherited text color. |
Accessibility
Role: generic. APG pattern: https://www.w3.org/WAI/ARIA/apg/.
Required ARIA attributes: none.
Keyboard
None declared.
Verification
Each category is reviewed separately. Automated keyboard and axe results do not attest manual or assistive-technology review.
| Category | Status | Evidence |
|---|---|---|
| Automated keyboard | Not reviewed | No declared key is mapped to a browser test yet. |
| Manual interaction | Not reviewed | No review recorded. |
| Assistive technology | Not reviewed | No review recorded. |
Examples
accordion/deployment-faq
Multiple-expansion release policy accordion with expand/collapse actions and responsive header.
<script setup lang="ts">
import { ref } from 'vue'
import {
GhostAccordion,
GhostAccordionContent,
GhostAccordionItem,
GhostAccordionTrigger,
GhostBadge,
GhostButton,
} from '@ghostvue/themes'
const openSections = ref<string[]>(['rollbacks'])
function expandAll(): void {
openSections.value = ['rollbacks', 'regions', 'retention']
}
function collapseAll(): void {
openSections.value = []
}
</script>
<template>
<div class="faq-showcase">
<div class="faq-showcase__header">
<div class="faq-showcase__heading">
<div class="faq-showcase__title-row">
<span class="faq-showcase__title">Production release policy</span>
<GhostBadge tone="neutral" variant="outline" size="sm">
3 sections
</GhostBadge>
</div>
<span class="faq-showcase__subtitle">
Standard operating procedures for rollbacks, regions, and audit logs.
</span>
</div>
<div class="faq-showcase__controls">
<GhostButton
size="sm"
variant="outline"
tone="neutral"
@click="expandAll"
>
Expand all
</GhostButton>
<GhostButton
size="sm"
variant="ghost"
tone="neutral"
@click="collapseAll"
>
Collapse all
</GhostButton>
</div>
</div>
<GhostAccordion
v-model="openSections"
type="multiple"
:heading-level="2"
class="faq-showcase__accordion"
>
<GhostAccordionItem value="rollbacks">
<GhostAccordionTrigger>
Zero-downtime rollback window
</GhostAccordionTrigger>
<GhostAccordionContent>
<div class="faq-showcase__panel">
<span class="faq-showcase__copy">
Previous container digests remain pinned for 72 hours after
promotion so traffic shifts back in under 15 seconds.
</span>
</div>
</GhostAccordionContent>
</GhostAccordionItem>
<GhostAccordionItem value="regions">
<GhostAccordionTrigger>
Regional failover sequencing
</GhostAccordionTrigger>
<GhostAccordionContent>
<div class="faq-showcase__panel">
<span class="faq-showcase__copy">
Primary edges drain before standby clusters accept writes, keeping
session tokens consistent across zones.
</span>
</div>
</GhostAccordionContent>
</GhostAccordionItem>
<GhostAccordionItem value="retention">
<GhostAccordionTrigger>
Audit log retention & export
</GhostAccordionTrigger>
<GhostAccordionContent>
<div class="faq-showcase__panel">
<span class="faq-showcase__copy">
Operator attestations and deployment diffs are retained for 365
days and exported nightly to cold storage.
</span>
</div>
</GhostAccordionContent>
</GhostAccordionItem>
</GhostAccordion>
</div>
</template>
<style scoped>
.faq-showcase {
display: grid;
gap: var(--ghost-space-stack-md);
}
.faq-showcase__header {
display: grid;
gap: var(--ghost-space-gap-sm);
}
.faq-showcase__heading {
display: grid;
gap: var(--ghost-space-gap-xs);
min-inline-size: 0;
}
.faq-showcase__title-row {
align-items: center;
display: flex;
flex-wrap: wrap;
gap: var(--ghost-space-gap-sm);
}
.faq-showcase__title {
color: var(--ghost-text-default);
font-size: var(--ghost-type-size-md);
font-weight: var(--ghost-type-weight-semibold);
line-height: var(--ghost-type-line-snug);
}
.faq-showcase__subtitle {
color: var(--ghost-text-muted);
font-size: var(--ghost-type-size-sm);
line-height: var(--ghost-type-line-normal);
}
.faq-showcase__controls {
display: flex;
flex-wrap: wrap;
gap: var(--ghost-space-gap-xs);
}
.faq-showcase__panel {
display: grid;
gap: var(--ghost-space-gap-xs);
}
.faq-showcase__copy {
color: var(--ghost-text-muted);
font-size: var(--ghost-type-size-sm);
line-height: var(--ghost-type-line-normal);
}
@container ghost-demo (min-width: 30rem) {
.faq-showcase__header {
align-items: start;
grid-template-columns: minmax(0, 1fr) auto;
}
}
</style>
accordion/billing-faq
Single collapsible expansion with a decorative plus/minus indicator that follows aria-expanded.
<script setup lang="ts">
import {
GhostAccordion,
GhostAccordionContent,
GhostAccordionItem,
GhostAccordionTrigger,
} from '@ghostvue/themes'
const questions = [
{
value: 'charge-date',
question: 'When is my card charged?',
answer:
'On the first day of each billing period. The receipt goes to the billing contact on the account.',
},
{
value: 'plan-change',
question: 'Can I change plans mid-cycle?',
answer:
'Yes. Upgrades apply at once with a prorated charge; downgrades start with the next billing period.',
},
{
value: 'refunds',
question: 'How do refunds work?',
answer:
'Unused seats are credited to the next invoice. Annual plans are refundable within 14 days of renewal.',
},
] as const
</script>
<template>
<div class="billing-faq">
<span class="billing-faq__title">Billing questions</span>
<!--
Single mode with `collapsible`: opening one answer closes the other,
and the open answer can still be closed again.
-->
<GhostAccordion
type="single"
collapsible
:heading-level="2"
default-value="charge-date"
>
<GhostAccordionItem
v-for="item in questions"
:key="item.value"
:value="item.value"
>
<GhostAccordionTrigger>
<span class="billing-faq__question">{{ item.question }}</span>
<!--
Decorative: the trigger already exposes the state through
aria-expanded, so the plus/minus is hidden from assistive
technology and only mirrors that attribute visually.
-->
<svg
class="billing-faq__indicator"
viewBox="0 0 16 16"
width="16"
height="16"
aria-hidden="true"
focusable="false"
>
<path d="M3 8h10" />
<path class="billing-faq__indicator-vertical" d="M8 3v10" />
</svg>
</GhostAccordionTrigger>
<GhostAccordionContent>
<span class="billing-faq__answer">{{ item.answer }}</span>
</GhostAccordionContent>
</GhostAccordionItem>
</GhostAccordion>
</div>
</template>
<style scoped>
.billing-faq {
display: grid;
gap: var(--ghost-space-stack-sm);
}
.billing-faq__title {
color: var(--ghost-text-default);
font-size: var(--ghost-type-size-md);
font-weight: var(--ghost-type-weight-semibold);
line-height: var(--ghost-type-line-snug);
}
.billing-faq__question {
min-inline-size: 0;
}
.billing-faq__indicator {
fill: none;
flex: none;
margin-inline-start: auto;
stroke: currentColor;
stroke-linecap: round;
stroke-width: 1.5;
}
.billing-faq__indicator-vertical {
transform-origin: center;
transition: transform var(--ghost-motion-duration-fast) ease-out;
}
/* Expanded collapses the vertical stroke, turning the plus into a minus. */
[aria-expanded='true'] .billing-faq__indicator-vertical {
transform: scaleY(0);
}
@media (prefers-reduced-motion: reduce) {
.billing-faq__indicator-vertical {
transition: none;
}
}
.billing-faq__answer {
color: var(--ghost-text-muted);
font-size: var(--ghost-type-size-sm);
line-height: var(--ghost-type-line-normal);
}
</style>
accordion/basic
Single expansion with collapsible coordination over panels.
Carriers schedule pickup across the west coast hubs every weekday.
Return labels stay valid for thirty days after delivery confirmation.
Hardware coverage includes replacement parts for manufacturing faults.
<script setup lang="ts">
import {
GhostAccordion,
GhostAccordionContent,
GhostAccordionItem,
GhostAccordionTrigger,
} from '@ghostvue/vue'
</script>
<template>
<GhostAccordion
type="single"
collapsible
:heading-level="2"
default-value="shipping"
>
<GhostAccordionItem value="shipping">
<GhostAccordionTrigger>Shipping regions</GhostAccordionTrigger>
<GhostAccordionContent>
<p>
Carriers schedule pickup across the west coast hubs every weekday.
</p>
</GhostAccordionContent>
</GhostAccordionItem>
<GhostAccordionItem value="returns">
<GhostAccordionTrigger>Returns window</GhostAccordionTrigger>
<GhostAccordionContent>
<p>
Return labels stay valid for thirty days after delivery confirmation.
</p>
</GhostAccordionContent>
</GhostAccordionItem>
<GhostAccordionItem value="warranty">
<GhostAccordionTrigger>Warranty terms</GhostAccordionTrigger>
<GhostAccordionContent>
<p>
Hardware coverage includes replacement parts for manufacturing faults.
</p>
</GhostAccordionContent>
</GhostAccordionItem>
</GhostAccordion>
</template>
accordion/themed
Multiple expansion with default surface styles.
<script setup lang="ts">
import {
GhostAccordion,
GhostAccordionContent,
GhostAccordionItem,
GhostAccordionTrigger,
} from '@ghostvue/themes'
</script>
<template>
<div class="accordion-themed-example">
<GhostAccordion
type="multiple"
:heading-level="2"
:default-value="['inventory']"
>
<GhostAccordionItem value="inventory">
<GhostAccordionTrigger>Inventory holds</GhostAccordionTrigger>
<GhostAccordionContent>
<span class="accordion-themed-example__copy">
Reserved stock releases when payment clears or the hold expires.
</span>
</GhostAccordionContent>
</GhostAccordionItem>
<GhostAccordionItem value="compliance">
<GhostAccordionTrigger>Compliance notes</GhostAccordionTrigger>
<GhostAccordionContent>
<span class="accordion-themed-example__copy">
Audit bundles include serial history and operator attestations.
</span>
</GhostAccordionContent>
</GhostAccordionItem>
</GhostAccordion>
</div>
</template>
<style scoped>
.accordion-themed-example {
display: grid;
}
.accordion-themed-example__copy {
color: var(--ghost-text-muted);
font-size: var(--ghost-type-size-sm);
line-height: var(--ghost-type-line-normal);
}
</style>