Using Builder's GenUI with Your Design System | 6/12

Announcing Visual Copilot - Figma to production in half the time

Builder logo
builder.io
Contact SalesGo to App

Using Builder's GenUI with Your Design System | 6/12

Announcing Visual Copilot - Figma to production in half the time

Builder logo
builder.io

Blog

Home

Resources

Blog

Forum

Github

Login

Signup

×

Visual CMS

Drag-and-drop visual editor and headless CMS for any tech stack

Theme Studio for Shopify

Build and optimize your Shopify-hosted storefront, no coding required

Resources

Blog

Get StartedLogin

Define custom actions to trigger on Element events by registering actions within your codebase. Use custom actions to trigger functions within your codebase, such as engagement events or tracking details.

This feature is accessible within the Classic UI mode of the Visual Editor.

  • Use the registerAction() function to register custom actions.
  • Once a content entry has access to a custom action, access it within the Element Events panel in the Data tab.

Within your codebase, register a custom action with the registerAction() function. Your custom action will require an id, name, kind, and action.

Each key-value pair functions in the following way:

  • id: a globally unique ID for an action
  • name: the name that will appear within the Visual Editor for the action
  • kind: the type of action; can be function, expression, or any
  • action: a function that returns a string representation of code that should run when the action is triggered

For more dynamic custom actions, add inputs to your actions. The inputs key can be added to the argument for registerAction(), which accepts an array of input objects.

These values can then be accessed within the action anonymous function. In the example below, a new input with a name of alertMessage is created that is required and accepts a string. The value of this input is then used within the action anonymous function.

To use the custom action you've registered within your content entry:

These values can then be accessed within the action anonymous function. In the example below, a new input with a name of alertMessage is created that is required and accepts string. The value of this input is then used within the action anonymous function.

In the video below, a button is selected and a custom Alert Action is triggered on button click. This causes an alert to appear on the page with the string provided to the custom input.

Read more about binding data and events within the Data binding overview. Or, learn how to add Custom code directly within the Visual Editor.

Was this article helpful?

Product

Visual CMS

Theme Studio for Shopify

Sign up

Login

Featured Integrations

React

Angular

Next.js

Gatsby

Get In Touch

Chat With Us

Twitter

Linkedin

Careers

© 2020 Builder.io, Inc.

Security

Privacy Policy

Terms of Service

Get the latest from Builder.io

By submitting, you agree to our Privacy Policy

  • Platform Overview

    AI Overview

  • Integrations

  • What's New

  • Figma to Code Guide

  • Composable Commerce Guide

  • Headless CMS Guide

  • Headless Commerce Guide

  • Composable DXP Guide

  • Design to Code

  • Blog

  • Knowledge Base

  • Community Forum

  • Partners

  • Templates

  • Success Stories

  • Showcase

  • Resource Center

    Glossary

© 2025 Builder.io, Inc.

Security

Privacy Policy

SaaS Terms

Compliance

Cookie Preferences

Gartner Cool Vendor 2024