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

# defineInlineObject

> **defineInlineObject**\<`TType`\>(`config`): [`InlineObject`](/api/editor/type-aliases/inlineobject/)

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

Define a non-editable inline object renderer for a `_type` declared
in the schema's `inlineObjects` array.

The render must always render `children` somewhere inside the outer
element. `children` carries an engine-emitted void spacer the browser
uses to anchor the caret next to the element. Dropping `children`
makes the caret unable to land on the element.

:::caution[Alpha]
This API should not be used in production and may be trimmed from a public release.
:::

## Type Parameters

### TType

`TType` *extends* `string`

## Parameters

### config

#### render?

[`InlineObjectRender`](/api/editor/type-aliases/inlineobjectrender/)

#### type

`TType` *extends* `"block"` ? `"Error: defineInlineObject({type: 'block'}) is forbidden -- 'block' is always a text block, use defineTextBlock"` : `TType` *extends* `"span"` ? `"Error: defineInlineObject({type: 'span'}) is forbidden -- 'span' is always a span, use defineSpan"` : `TType`

## Returns

[`InlineObject`](/api/editor/type-aliases/inlineobject/)

## Example

```ts
defineInlineObject({
  type: 'mention',
  render: ({attributes, children, node}) => (
    <span {...attributes}>
      {children}
      @{(node as {username?: string}).username}
    </span>
  ),
})
```