## 🔌 Building Alpha Plugin Series – Part [2] : Handling `EVENT` Type Attributes in Alpha Plugins

Welcome back to the Building Alpha Plugin Series :waving_hand:

In the previous posts( ## :rocket: Getting Started with Building Alpha plugins - Neutrinos Platform - Neutrinos), we laid the groundwork for building and configuring Alpha plugins. Today, we’re diving into a key feature for building interactive and reusable components — the EVENT attribute type.


:high_voltage: What is ATTRIBUTE_TYPE.EVENT?

In Alpha plugins, @AlphaAttribute can be used to declare an event that the plugin can emit.

Here’s how we declare it:

ts

@AlphaAttribute({
    type: ATTRIBUTE_TYPE.EVENT,
    label: 'On row click',
    event: 'table:row-click',
})

:pushpin: Breakdown

Property Description
type Tells Alpha this attribute is an event (ATTRIBUTE_TYPE.EVENT).
label Display name in the Alpha Studio UI when binding to this event.
event The event name that your plugin will emit. Other components or flows can listen for this.

:brain: How to Emit the Event

Let’s say you’re building a custom table plugin, and you want to do something like API request, custom code, navigation ect… whenever a row is clicked.

Here’s how you emit the event from inside your plugin:
Please remember that Alpha plugins are built using Lit web component(Create Lit project locally).

ts

private onRowClick(row) {
    this.dispatchEvent(
        new CustomEvent('table:row-click', {
            detail: { row },
            bubbles: true,
            composed: true,
        }) as
    );
}

This makes the event available for Alpha Studio’s event binding system, enabling things like opening dialogs, API Requests, Custom code , or navigation — all without modifying the plugin itself.

NB: The value given on event in the @AlphaAttributribute should be the custom event emitted on the method.


:light_bulb: Alpha Studio Binding

In Alpha Studio, once you’ve declared an alpha attribuete as an EVENT attribute like above, Studio users can:

  • See On row click in the Triggers panel.
  • Bind it to an action: like opening dialogs, API Requests, Custom code, or navigation.


This gives your plugin reusability and configurability without hardcoding any logic.


:end_arrow: Summary

By using ATTRIBUTE_TYPE.EVENT and CustomEvent, you enable your plugin to:

  • Emit custom, well-scoped events.
  • Integrate seamlessly into the Alpha platform’s event-driven triggers.

In the next post, we’ll dive deeper more on the below:

  • uiType: TYPED_INPUT`
  • How options and fieldMappings enable dynamic data bindings :counterclockwise_arrows_button:

Until then — keep building amazing things in Alpha! :rocket:

:thread: Follow the thread, try it out in your own plugin, and let me know what you’d like to learn next.

#AlphaPlugins #AlphaAttributes #AlphaStudio #NeutrinosPlatform

8 Likes