# Creating a component event

**URL:** <https://forum.inductiveautomation.com/t/creating-a-component-event/30403>\
**Category:** Module Development\
**Tags:** perspective\
**Created:** [December 3, 2019, 1:28pm UTC](https://forum.inductiveautomation.com/t/creating-a-component-event/30403 "2019-12-03T13:28:27Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [December 3, 2019, 4:34pm UTC](https://forum.inductiveautomation.com/t/creating-a-component-event/30403/2 "2019-12-03T16:34:27Z")

</div>

First, you’ll want to add the event to your schema.json, assuming you’re using one; provide an `events` array that has at least a `name` and `description`, and as much schema information as applicable, if you’re passing contextual information:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/e/eaa7dcd2f335d5dd29a58ec828eabb834e122a75.png)

From there, it depends on which side you’re firing this event from. From the frontend, your component props will have a `componentEvents`, which is an instance of…`ComponentEvents` - that class has a `fireComponentEvent` function that accepts an event name and a payload.

If you want to fire a component event from the Java side, you’ll need to register a custom ModelDelegate - from there, the Component instance your delegate receives will have a `fireEvent` method that takes three arguments, one of which will be the static `EventConfig.COMPONENT_EVENTS`.

---

_[View the full topic](https://forum.inductiveautomation.com/t/creating-a-component-event/30403)._
