Docs
API Reference
Actions

Actions

⚠️ The plugin API is highly experimental and is likely to experience breaking changes.

Actions enable you to make changes to the internal AppState via the dispatch method.

This is a partial reference of the most useful actions. A full reference is available in the codebase (opens in a new tab).

Types

setData

Modify the data payload currently managed by Puck.

ParamExampleTypeStatus
typetype: "setData""setData"Required
datadata: {}DataRequired

Example

dispatch({ type: "setData", data: {} });

setUi

Change a value on Puck's UI state.

ParamExampleTypeStatus
typetype: "setData""setData"Required
uiui: { leftSideBarVisible: false }UiStateRequired

Example

dispatch({ type: "setUi", ui: { leftSideBarVisible: false } });