Actions
Reference for built-in and custom ContentKit actions
ContentKit actions handle events in your component. GitBook provides built-in actions, and your component can define custom actions.
Built-in actions
@editor.node.updateProps
Updates properties stored on the editor node bound to the current component. GitBook dispatches this action when component props change:
{
"action": "@editor.node.updateProps",
"props": {}
}@ui.url.open
Opens a URL:
{
"action": "@ui.url.open",
"url": "https://www.gitbook.com"
}@ui.modal.open
Opens componentId as an overlay modal with props:
{
"action": "@ui.modal.open",
"componentId": "myModal",
"props": {}
}@ui.modal.close
Closes the current modal. Call this action from a modal component. It can include return data from the modal:
@webframe.ready
Signals that a webframe is ready to receive messages and updates:
@webframe.resize
Resizes a webframe container:
@link.unfurl
GitBook sends this action to a block when someone pastes a matching URL:
Configure URL patterns in your integration manifest:
Follow Create a custom unfurl action for a complete example.
Custom actions
Define custom action names in your component. The action name is available on the action object:
Last updated
Was this helpful?