🔮 Sanity Create is here. Writing is reinvented. Try now, no developer setup

Structure: Action or intent required

Menu items needs to know what to do when they are selected. This can done by specifying one of to parameters:

  • action - which is a function called with the parameters set for this menu item
  • intent - an object containing a name and an optional bag of params

Certain nodes within the desk structure requires a document ID to operate on.

Setting an action or intent can be done by calling the action() or intent() methods, respectively:

new MenuItemBuilder()
  .title('Open in website')
  .params({breed: 'schnauzer'})
  .action(params => {

Was this article helpful?