Collapse
The Collapse component is an easy way to toggle the visibility of content with show/hide functionality. It has two elements: a disclosure button and a section of content whose visibility is controlled by the button. The component implements the W3C ARIA APG Disclosure (Show/Hide) Pattern and also supports the W3C ARIA APG Accordion Pattern.
Examples
Base
A custom trigger can be passed in the trigger slot.
Accessibility Note:
The trigger container is already an interactive element with therole="button" attribute. For accessibility reasons, prevent adding other interactive elements such as buttons to avoid nested-interactive accessibility problems. Accordion
Combine multiple collapse components to create an accordion behaviour.
Collapse Component
An easy way to toggle what you want.
html
<o-collapse></o-collapse>Props
| Prop name | Description | Type | Values | Default |
|---|---|---|---|---|
| animation | Custom animation (transition name) | string | - | From config: collapse: { |
| contentId | Id property of the content container - default is an uuid | string | - | useId() |
| expanded | Expand the trigger to fullwidth | boolean | - | false |
| open | Whether collapse is open or not, use v-model:open to make it two-way binding | boolean | - | true |
| override | Override existing theme classes completely | boolean | - | |
| position | Trigger position | "bottom" | "top" | top, bottom | From config: collapse: { |
| triggerId | Id property of the trigger container - default is an uuid | string | - | useId() |
Events
| Event name | Properties | Description |
|---|---|---|
| update:open | value boolean - updated open prop | open prop two-way binding |
| open | on collapse opened | |
| close | on collapse closed |
Slots
| Name | Description | Bindings |
|---|---|---|
| trigger | Define the collapse trigger | open boolean - collapse open state |
| default | Default content |
Class Inspector
| Class prop | Description | Props | Suffixes | |
|---|---|---|---|---|
| rootClass | Class of the root element. | |||
| positionClass | Class of the root element with position. | position | ||
| triggerClass | Class of the trigger element. | |||
| expandedClass | Class of the trigger element when expanded. | expanded | ||
| contentClass | Class of the content element. |
Sass Variables
Current theme ➜ Bulma
The theme does not have any custom variables for this component.
Current theme ➜ Bootstrap
The theme does not have any custom variables for this component.
