# TemplateDefinition

typedef

An object describing a single template definition.

```json
{
// Mandatory fields:
	title: 'Example template',
	data: '<table><tr><td>Cell #1</td><td></td></tr><tr><td></td><td>Cell #2</td></tr></table>',

	// Optional configuration:
	icon: '<svg viewBox="0 0 45 45" xmlns="http://www.w3.org/2000/svg">...</svg>',
	description: 'This template inserts a table.'
}
```

<a id="properties">

## Properties

<a id="member-data">

### `data: () => string | string`

An HTML string to be inserted into the document or a callback function that returns an HTML string to be inserted into the document when the template is selected.

<a id="member-description">

### `description?: string`

An optional long description of the template presented to the users.

<a id="member-icon">

### `icon?: string`

An optional SVG string representing the icon of the template. The default size of the icon is 45x45 pixels. Be sure to set the correct `viewBox` attribute in the icon source. If not provided, a generic icon will be used instead.

<a id="member-title">

### `title: string`

The title of the template.

#### Value

`object`

---

Full index of the CKEditor 5 API reference: [llms.txt](llms.txt)
