Collapsible

Storybook

A collapsible is a component consisting of an interactive anchor that toggled the expandable/collapsible element.

Preview

The collapsible component consists of two parts: the anchor and the content. If the anchor slot is not filled, the anchor will default to a basic button with text. The content must be provided and is the element that can be hidden or shown when the anchor is clicked.

Basic Usage Without Anchor Slot

With Anchor Slot

Vue API

Slots

Name
Description
anchor

Slot for the anchor element that toggles the collapsible content

content

Slot for the collapsible element that is expanded by the anchor

Props

Name
Description
Default
anchorClass

Additional class name for the anchor wrapper element.

Type: string|array|object
null
anchorText

Text that is displayed on the anchor if nothing is passed in the slot. Ignored if the anchor slot is used.

Type: string
null
ariaLabel

Label on the collapsible content. Should provide this or ariaLabelledBy but not both.

Type: string
null
ariaLabelledBy

Id of the element that labels the collapsible content. Defaults to the anchor element. Should provide this or ariaLabel but not both.

Type: string
null
contentClass

Additional class name for the content wrapper element.

Type: string|array|object
null
contentElementType

HTML element type (tag name) of the content wrapper element.

Type: string
'div'
elementType

HTML element type (tag name) of the root element of the component.

Type: string
'div'
id

The id of the content wrapper.

Type: string
function() { return getUniqueString(); }
maxHeight

The maximum height of the collapsible element. Possible units rem|px|%|em

Type: string
null
maxWidth

The maximum width of the anchor and collapsible element. Possible units rem|px|%|em

Type: string
null
open

Controls whether the collapsible is shown. Leaving this null will have the collapsible start expanded and trigger on click by default. If you set this value, the default trigger behavior will be disabled, and you can control it as you need. Supports .sync modifier

Type: boolean
Values: nulltruefalse
null

Events

Name
Description
opened

Event fired when the content is shown or hidden

Type: Boolean
update:open

Event fired to sync the open prop with the parent component

Type: undefined
Collapsible documentation last updated Thursday, June 11, 2026