Skip to content Skip to footer navigation
You are reading the Statamic 6 Alpha docs. 👀

Event Bus

For situations where emitting an event to the parent component doesn't make sense, Statamic has a global event bus. You can emit and listen to events directly on this which will be available to all Vue components.

import { events } from '@statamic/cms/api';
// Emit from some component...
events.$emit('event.name');
// Listen for it in another component...
events.$on('event.name');
Hot Tip!

The event bus is intended to be used for Vue component communication. If you want to listen for Statamic driven "events", check out Hooks.

A troll pointing a teaching stick