---
schema_version: "1"
id: 18b1f2b9f01679ad3a652a926a5a6a4843c27c4e8019701799edf6c6c70d1985
title: Create Custom Component Events
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/platform/aura-platform/guides/aura/events/events-component-create.md
canonical_url: https://developer.salesforce.com/docs/platform/aura-platform/guide/events-component-create.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: db0ac42a5b1cf610d2b95b2bdb5f5a2954158b8dfcadaa589e0699f213c5f90e
products:
  - Lightning Aura Components Developer Guide
  - Platform Developer Content
---

# Create Custom Component Events

Create a custom component event using the `<aura:event>` tag in a .evt resource. Events can contain attributes that can be set before the event is fired and read when the event is handled.

Use `type="COMPONENT"` in the `<aura:event>` tag for a component event. For example, this c:compEvent component event has one attribute with a name of `message`.

```nolang
<!--c:compEvent-->
<aura:event type="COMPONENT">
    <!-- Add aura:attribute tags to define event shape.
         One sample attribute here. -->
    <aura:attribute name="message" type="String"/>
</aura:event>
```

The component that fires an event can set the event’s data. To set the attribute values, call `event.setParam()` or `event.setParams()`. A parameter name set in the event must match the `name` attribute of an `<aura:attribute>` in the event. For example, if you fire `c:compEvent`, you could use:

```javascript
event.setParam("message", "event message here");

```

The component that handles an event can retrieve the event data. To retrieve the attribute value in this event, call `event.getParam("message")` in the handler’s client-side controller.

