Vivid API

Accordion

Accordion and Accordion Item work together to provide a vertically stacked list of headers that reveal or hide associated sections of content.

Usage

import { VAccordion, VAccordionItem } from '@vonage/vivid-api-vue';
import { registerAccordion } from '@vonage/vivid-api';
import { registerAccordionItem } from '@vonage/vivid-api';
registerAccordion('your-prefix');
registerAccordionItem('your-prefix');

Heading level

Use the heading-level to set level of the Accordion Item’s headline element to ensure accessible heading levels.

Methods

Close All

Use the closeAll method on Accordion to programatically close all open Accordion Item’s.

Slots

The HTML specification does not allow one interactive element to be nested within another. Therefore, you should not use any links or buttons inside heading or meta slots.

Icon Slot

Heading Slot

Use the heading slot to add custom content to the Accordion Item’s heading, allowing you to apply custom formatting. If set, the heading attribute is ignored.

Meta Slot

Set the meta slot to add additional content to the accordion item’s heading. If set, the meta attribute is ignored.

CSS Variables

Meta Data Inline Size

Use the --accordion-item-meta-inline-size to control the width of the meta-data slot content. The defaut value is 20%

API Reference

accordion

Properties

PropertyTypeDefaultDescription
expandmode'single' | 'multi'Determines if multiple items or a single item can opened at once
PropertyTypeDefaultDescription
expand-mode'single' | 'multi'Determines if multiple items or a single item can opened at once

Slots

NameDescription
defaultDefault slot.
NameDescription
defaultDefault slot.

Events

NameTypeDescription
changeCustomEvent<string | null>Fires a custom 'change' event when the active item changes
NameTypeDescription
changeCustomEvent<string | null>Fires a custom 'change' event when the active item changes

Methods

NameParamsReturnsDescription
closeAllvoid

accordion-item

Properties

PropertyTypeDefaultDescription
appearance'ghost' | 'filled' | 'ghost-light'The appearance the button should have.
expandedbooleanExpands or collapses the item.
headingstring
headinglevel1 | 2 | 3 | 4 | 5 | 6Configures the https://www.w3.org/TR/wai-aria-1.1/#aria-level | level of the heading element.
iconTrailingbooleanIndicates the icon affix alignment.
idstringThe item ID
metastring
noIndicatorbooleanIndicates whether the accordion-item has indicator
size'condensed' | 'normal'The size the accordion-item should have.
PropertyTypeDefaultDescription
appearance'ghost' | 'filled' | 'ghost-light'The appearance the button should have.
expandedbooleanExpands or collapses the item.
headingstring
heading-level1 | 2 | 3 | 4 | 5 | 6Configures the https://www.w3.org/TR/wai-aria-1.1/#aria-level | level of the heading element.
icon-trailingbooleanIndicates the icon affix alignment.
idstringThe item ID
metastring
no-indicatorbooleanIndicates whether the accordion-item has indicator
size'condensed' | 'normal'The size the accordion-item should have.

Slots

NameDescription
defaultDefault slot.
headingUsed to add content to the heading.
iconThe preferred way to add an icon to the component.
metaUsed to add additional content to the heading.
NameDescription
defaultDefault slot.
headingUsed to add content to the heading.
iconThe preferred way to add an icon to the component.
metaUsed to add additional content to the heading.

Events

NameTypeDescription
changeCustomEvent<undefined>Fires a custom 'change' event when the button is invoked
NameTypeDescription
changeCustomEvent<undefined>Fires a custom 'change' event when the button is invoked