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
- Create a new project directory for your widget.
-
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 a Widget definition, keep the
nameunique within your Widget scope. parametersrepresents 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.appearanddisappearrepresent the extended parameters this Widget provides forAppearandDisappearanimations respectively. Likeparameters, a Widget may not provide a definition for these fields. Refer to part D in the image above.defaultsindicates 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
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
React to extend new Form UIs for modifying properties.
Step 5: Handle Resource Loading
If your widget needs to load external resources, use Remotion’sdelayRender and continueRender:
Step 6: Create a Custom Panel
Create a panel for your widgets:Panel.ts
dispatchEvent method:
Step 7: Reigster Widgets and Panel
Finally, create aWidgetLibrary in your code and register the Widget(s) and Panel.
index.ts