Skip to content

Expansion panels ​

Composable accordion / disclosure UI: GkExpansionPanels owns v-model (open panel keys), GkExpansionPanel registers a value and provides context to GkExpansionPanelTitle (header button) and GkExpansionPanelText (collapsible body). GK_EXPANSION_PANELS and GK_EXPANSION_PANEL are exported from god-kit/vue for advanced composition.

This is intentionally smaller than Vuetify’s expansion stack: no VDefaultsProvider, elevation/rounded prop matrices, or group item registry beyond value matching.

When to use ​

Use for grouped content where users reveal one or more sections on demand, especially for dense settings or FAQ-style layouts.

Live Examples ​

Accordion

Default multiple=false: at most one panel is expanded at a time.

Multiple open

Set multiple to allow several sections expanded together.

Disabled group

disabled prevents toggling; use for read-only review UIs.

GkExpansionPanels ​

Props ​

PropTypeDefaultDescription
modelValue(string | number)[][]Keys of expanded panels; use v-model
multiplebooleanfalseWhen false, at most one panel is open (accordion)
disabledbooleanfalseDisables toggling for all panels

Slots ​

SlotDescription
defaultGkExpansionPanel children

GkExpansionPanel ​

Props ​

PropTypeDefaultDescription
valuestring | numberautoStable key for v-model; defaults to an internal id when omitted (standalone panel)
disabledbooleanfalseDisables this panel’s toggle

Slots ​

SlotDescription
defaultTypically GkExpansionPanelTitle + GkExpansionPanelText and any custom nodes

GkExpansionPanelTitle ​

Header control: button, aria-expanded, aria-controls, focus ring. Must be a descendant of GkExpansionPanel.

Slots ​

SlotDescription
defaultVisible title

GkExpansionPanelText ​

Collapsible region: role="region", aria-labelledby, hidden when collapsed. Must be a descendant of GkExpansionPanel.

Slots ​

SlotDescription
defaultPanel body

Examples ​

Each scenario under Live Examples includes a copyable Vue snippet (source is imported from the same SFC as the preview).

Accessibility notes ​

  • GkExpansionPanelTitle renders button semantics; do not replace with non-focusable custom elements.
  • Keep heading text concise so screen reader users can scan sections quickly.

Out of scope (v1) ​

Nested expansion groups, lazy mount of body content, and parity with Vuetify’s before-active / after-active edge styling.

Released under the MIT License.