# realmPlugin

**Kind:** Function

**Source:** [`atloria-monorepo/packages/editor/src/RealmWithPlugins.tsx`](https://github.com/sherkety/atloria/blob/main/atloria-monorepo/packages/editor/src/RealmWithPlugins.tsx#L20)

A function that creates an editor plugin.

## Signature

```ts
function realmPlugin(plugin: {
  /**
   * Called when the MDXEditor component is mounted and the plugin is initialized.
   */
  init?: (realm: Realm, params?: Params) => void

  /**
   * Called after the MDXEditor component is mounted and all plugins are initialized.
   */
  postInit?: (realm: Realm, params?: Params) => void
  /**
   * Called on each re-render. Use this to update the realm with updated property values.
   */
  update?: (realm: Realm, params?: Params) => void
}): (params?: Params) => RealmPlugin
```

## Parameters

| Name | Type |
|---|---|
| `plugin` | `{
  /**
   * Called when the MDXEditor component is mounted and the plugin is initialized.
   */
  init?: (realm: Realm, params?: Params) => void

  /**
   * Called after the MDXEditor component is mounted and all plugins are initialized.
   */
  postInit?: (realm: Realm, params?: Params) => void
  /**
   * Called on each re-render. Use this to update the realm with updated property values.
   */
  update?: (realm: Realm, params?: Params) => void
}` |

**Returns:** `(params?: Params) => RealmPlugin`
