Skip to content

toggle

toggle is a DOM event that occurs whenever the accordion is toggled.

Event body

none

Example

In this example we listen to toggle event and perform an action whenever it's emitted.

useStorefront(async (storefront) => {
    document.addEventListener('toggle', () => {
        console.log('Accordion has been toggled');
    });
});