# Events

## Overview

Uncodie uses an Event propagation system that lets any component subscribe to triggers with different origins and use cases, you can create your events as well.

<div align="left"><figure><img src="https://616870859-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZ1eJ3100gppGz1pXp1J7%2Fuploads%2FSsS9Pxc7p3vwmnbNhnp6%2Fevents.png?alt=media&#x26;token=e3fbb4f0-3f14-4e1a-af2a-bcc8bc99a515" alt="" width="338"><figcaption></figcaption></figure></div>

## Setup

1. Open the Plugin in Figma
2. Select the layer or component you want to add an Event
3. In the **Actions** section click on "+" and select your new action from the list
4. You can add inline javascript by clicking on the "<>" button

<div align="left"><figure><img src="https://616870859-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZ1eJ3100gppGz1pXp1J7%2Fuploads%2FbwyPx6WFhHSbS5vSYION%2Finline.png?alt=media&#x26;token=89446b58-ed05-4280-921d-5971a08d3185" alt="" width="338"><figcaption></figcaption></figure></div>

4. Choose the trigger for your Action
5. Click on **Save**

## Use Cases

## Window Events

This events are related to every user and app execution

### On Click

Add this trigger to any event related to a normal click-to action in a layer or element

### On Mouse Over

Add this trigger to events like hovering in a layer or button

### On Mouse Leave

Add this event to layers to return their states to normal or to track special events when the mouse leaving a layer

### On Key Press

This trigger will have an argument with the key pressed

### On Key Up

This trigger will have an argument with the key pressed

### On Blur

Use this trigger when an element loses its focus, normally an input or a buttón

### On Render

Use this trigger to add events related to a component rendering on the screen.

## Custom Events

To create a custom event you required to register your event in a script manifest, for more information see:

{% embed url="<https://docs.uncodie.com/1.0/custom-scripts/manifest>" %}
