> For the complete documentation index, see [llms.txt](/llms.txt).
> The full corpus is at [llms-full.txt](/llms-full.txt).

# defineAnnotation

> **defineAnnotation**(`config`): [`Annotation`](/api/editor/type-aliases/annotation/)

Defined in: packages/editor/src/renderers/renderer.types.ts:556

Define an annotation renderer for a `_type` declared in the
schema's `annotations` array, or `'*'` to match every annotation
type. The returned registration is mounted via the `<NodePlugin>`
component.

Annotation `_type`s live in a different namespace than node
`_type`s, so `type` has no forbidden values here (unlike
`defineInlineObject`/`defineBlockObject`).

## Parameters

### config

#### render?

[`AnnotationRender`](/api/editor/type-aliases/annotationrender/)

#### type

`string`

## Returns

[`Annotation`](/api/editor/type-aliases/annotation/)

## Example

```ts
defineAnnotation({
  type: 'link',
  render: ({annotation, children}) => (
    <a href={(annotation as {href?: string}).href}>{children}</a>
  ),
})
```