Skip to main content

Build a custom mutator

1. Codelab overview​

What you'll learn​

  • What mutators are and when to use them
  • How to create a custom mutator
  • How to use context menus to create a custom mutator UI
  • When and how to fire events during a mutation

What you'll build​

A custom list mutator that uses the context menu to add and remove items.

Screenshot of the block built in this codelab. There are multiple inputs to the block, with a context menu open that shows options for 'Add Item' and 'Remove Item'

What you'll need​

  • Basic understanding of Blockly blocks, toolboxes, and workspaces.
  • Understanding of context menus in Blockly.
  • NPM installed (instructions).
  • Comfort using the command line/terminal.