Skip to content

Collapsible

SCollapsible is an expandable block: a trigger header controls the visibility of the content. It is built on Reka UI (aria-expanded, aria-controls, keyboard control). The chevron is a reusable SIcon that rotates in the open state. Two-way binding of the open state uses v-model:open.

Basic usage

Open by default

Indicator icon

The expand-icon prop sets the expand indicator icon (a registry name, chevron-right here).

Disabled

The disabled prop locks the trigger, so the block can be neither expanded nor collapsed.

Trigger slot

The #trigger slot replaces the title prop, so the header can hold an icon or custom markup.

Header colors

The header color and background come from the --s-collapsible-trigger-bg and --s-collapsible-trigger-color tokens (the latter also sets the chevron color). Dark or accent headers are common in mockups, so they do not need a rule with higher specificity:

API

Props

NameTypeDefaultDescription
titlestringundefinedTrigger title (an alternative to the trigger slot).
squarebooleanundefinedSquare corners: removes the border radius (rounded by default).
disabledbooleanfalsePrevents expanding and disables the trigger.
expand-iconstring"chevron-down"Icon of the expand indicator.
openbooleanfalseWhether the content is expanded. Two-way bound via v-model:open.

Events

NameSignatureDescription
update:open(value: boolean) => voidEmitted when open changes. Used for two-way binding (v-model:open).

Slots

NameDescription
triggerCustom trigger content (instead of the title prop).
defaultCollapsible content.