Docs
Extending Puck
Plugins

Plugin API

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

The plugin API enables developers to distribute plugins to customize the Puck interface.

Official plugins

Community plugins

Please see the awesome-puck repo (opens in a new tab) for a full list of community plugins.

Developing a plugin

Plugins implement the same overrides API used to build custom interfaces:

import { Puck } from "@measured/puck";
 
const MyPlugin = {
  overrides: {
    componentItem: ({ name }) => (
      <div style={{ backgroundColor: "hotpink" }}>{name}</div>
    ),
  },
};
 
export function Editor() {
  return (
    <Puck
      // ...
      plugins={[MyPlugin]}
    />
  );
}

Plugin currying

Plugins are rendered in the order they are defined. Unless otherwise specified, all overrides are curried, meaning that the return node of one plugin will be passed as children to the next plugin.

This may result in some incompatible plugin combinations. To improve your chance of building a widely compatible plugin, consider:

  1. Implementing as few override methods as you need
  2. Always rendering children if possible

Custom fields

Plugins enable full UI overhauls. If you're creating a field for a specific use-case, you might be better off distributing a custom field.

Further reading