Skip to main content
While BlendDuck offers a variety of built-in widgets, you may sometimes need functionality that isn’t available out of the box. This guide will walk you through the process of creating custom widgets for the BlendDuck platform.
Please note that because the front-end code for Widgets needs to run on the BlendDuck platform, we will work closely with clients on user experience, security, and rendering. Therefore, custom Widget development is only available for enterprise-level subscribers.

Prerequisites

Before you begin, ensure you have:
  • Node.js and npm installed
  • Familiarity with React and TypeScript
  • Basic understanding of the BlendDuck platform

Setting Up Your Development Environment

  1. Create a new project directory for your widget.
  2. Add the BlendDuck Widget SDK to your package.json:

Creating custom Widgets and Panel

Step 1: Apply a Custom Widget application

Contact us to apply for a Widget developer repository. BlendDuck will create a private git repository on Github and grant you collaborative development permissions. You can also choose to have the BlendDuck development team handle the custom development entirely. This git repository will include template code for Widget development, widget scope, and some build configurations.

Step 2: Define the Widget Structure

Create a new file (e.g., WidgetA/index.ts) and define your widget structure:
WidgetA/index.ts
In the image below, part A shows a custom Widget Panel, part B shows the Inspector panel, and parts C and D show the Appear animation and its corresponding Inspector panel. image
  • In a Widget definition, keep the name unique within your Widget scope.
  • parameters represents the parameters of this Widget that are open for user modification. When a Widget is selected, the BlendDuck editor will automatically build an Inspector panel for user modifications. A Widget may not provide a definition for this field. Refer to part B in the image above.
  • appear and disappear represent the extended parameters this Widget provides for Appear and Disappear animations respectively. Like parameters, a Widget may not provide a definition for these fields. Refer to part D in the image above.
  • defaults indicates additional default parameters for this Widget when creating a new one on the stage.

Step 3: Implement the Widget Component

Create a React component for your widget:
WidgetA/Widget.ts
You can then build your Widget according to React and Remotion best practices. After using @blendduck/widget-sdk, you can easily obtain the size of the Widget and the parameters passed by the user in the Inspector panel.

Step 4: Configure Widget Parameters

Define the schema and field configuration for your widget:
WidgetA/config.ts
BlendDuck provides over 40 built-in form types, which can help developers quickly build a unified UI Inspector. In addition, developers can use React to extend new Form UIs for modifying properties.

Step 5: Handle Resource Loading

If your widget needs to load external resources, use Remotion’s delayRender and continueRender:

Step 6: Create a Custom Panel

Create a panel for your widgets:
Panel.ts
You can add or update a Speech AudioPlay by dispatchEvent method:

Step 7: Reigster Widgets and Panel

Finally, create a WidgetLibrary in your code and register the Widget(s) and Panel.
index.ts

Step 8: Preview your custom Widgets

Start the project and open https://blendduck.com/dev in your browser for online debugging.

Build your Widgets and Panel

Once you’ve developed and tested your custom widget, submit your code via git. GitHub Action will automatically build and deploy the project. You can then access your extended Panel in BlendDuck to see the list of Widgets you’ve developed. By following this guide, you can create powerful, custom widgets that extend the capabilities of the BlendDuck platform. Remember to stay updated with the latest BlendDuck SDK documentation for any new features or changes in the development process.