Action Extension
In NocoBase, an Action is a button within a block that triggers business logic — such as "Create", "Edit", "Delete", etc. By extending the ActionModel base class, you can add custom action buttons.
Action Scenes
Each action needs to declare the scene in which it appears, specified via the static scene property:
Examples
Collection-Level Action
Operates on the entire collection, appears in the action bar at the top of the block:
Record-Level Action
Operates on a single record, appears in the action column of each table row:
Available in Both Scenes
If the action doesn't distinguish between scenes, use ActionSceneEnum.both:
The structure of all three patterns is identical — the only differences are the static scene value and the button text in defaultProps.
Registering Actions
Register with registerModelLoaders for lazy loading in the Plugin's load() method:
After registration, you can add your custom action buttons in the block's "Configure actions" menu.
Full Source Code
- @nocobase-example/plugin-simple-action — Complete example of all three action scenes
Related Links
- Plugin Tutorial: Building Custom Action Buttons — Build action buttons for all three scenes from scratch
- Plugin Tutorial: Building a Full-Stack Data Management Plugin — Custom actions + ctx.viewer.dialog in a real-world complete plugin
- FlowEngine Overview — FlowModel basics
- Block Extension — Custom blocks
- Field Extension — Custom field components
- FlowDefinition — Complete parameters and event types for registerFlow
- FlowEngine Full Documentation — Complete reference

