> For the complete documentation index, see [llms.txt](https://docs.goril.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.goril.app/main-pages/custom-code/custom-actions.md).

# Custom Actions

Create a custom action reusable throughout the application.

## Creating a Custom Action

In order to create a **Custom Action** follow the next steps :

* Click on the **Add** button and select **Actions** in the opened list
* Set the **Name** of your action on the right properties panel
* Add a **Tag** to group your custom actions
* Choose if your action should be **Async** or not
* Choose if you passe the **Build Context** in the action
* Add any **Parameters** you need
* Choose the **Return Type**
* Write your code in the central editor
* Save by clicking on the top right button **Save**

<figure><img src="https://2361990732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FruhMqqOvKXgZPke0Ehds%2Fuploads%2FACucVexs5f2U5FF2dt2I%2FCleanShot%202023-05-25%20at%2011.23.00%402x.png?alt=media&amp;token=0f6fa2a0-b38d-4b24-864c-4152e84ae4cb" alt=""><figcaption><p>Example of a custom action that use a custom dependency and show a Toast on button click</p></figcaption></figure>

## Use a Custom Action

<figure><img src="https://2361990732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FruhMqqOvKXgZPke0Ehds%2Fuploads%2FkYHbfs3n8qSF37jvLqtV%2FCleanShot%202023-05-25%20at%2011.24.12.gif?alt=media&amp;token=d1be3021-7233-47b6-8202-c567d229a808" alt=""><figcaption><p>Example of use of a custom action that show a Toast on button click</p></figcaption></figure>

<figure><img src="https://2361990732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FruhMqqOvKXgZPke0Ehds%2Fuploads%2FJGddrrTmfv1MNqTrvk2W%2FCleanShot%202023-05-25%20at%2011.29.36.gif?alt=media&amp;token=28f75a99-6507-41f6-b1f5-3a3bde56e36f" alt="" width="341"><figcaption><p>Example of a custom action in a running application</p></figcaption></figure>
