---
title: Custom Icons / Font Awesome
description: Replace Jodit toolbar icons with custom SVG or Font Awesome icons.
keywords: custom icons, font awesome, toolbar icons
---

# Custom icons / Use Font awesome

Jodit provides several ways to replace toolbar icons.
You can replace one icon or all icons at once.

## Customize one icon

You can replace the icon for a specific button:

```javascript
Jodit.make('#editor', {
	controls: {
		bold: {
			iconURL: 'https://xdsoft.net/favicon.png'
		}
	}
});
```

Or through the module [Icon](https://xdsoft.net/jodit/docs/modules/icons.html)

```javascript
Jodit.modules.Icon.set(
	'brush',
	`<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
  <circle cx="50" cy="50" r="50" />
</svg>`
);
Jodit.make('#editor');
```

### Result

```html
<!-- Example Start -->
<textarea id="editor1">Some text</textarea>
<script>
	Jodit.modules.Icon.set(
		'brush',
		`<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
    <circle cx="50" cy="50" r="50" />
  </svg>`
	);
	Jodit.make('#editor1', {
		controls: {
			bold: {
				iconURL: 'https://xdsoft.net/favicon.png'
			}
		}
	});
</script>
<!-- Example End -->
```

## Replace all icons

Or replace all icons in Jodit.

For example, let's connect Jodit with Font Awesome icons

Include Jodit and and the CDN Font Awesome

```html
<link
	rel="stylesheet"
	href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"
/>
<link rel="stylesheet" href="build/jodit.min.css" />
<script src="build/jodit.min.js"></script>
```

Create input element

```html
<textarea id="editor">Some text</textarea>
```

And define method `getIcon`:

```javascript
Jodit.make('#editor', {
	getIcon: function (name, clearName) {
		let code = name;

		// not all font awesome icons is matched to Jodit icons
		switch (clearName) {
			case 'redo':
				code = 'rotate-right';
				break;
		}

		return (
			'<i style="font-size:14px" class="fa fa-' + code + ' fa-xs"></i>'
		);
	}
});
```

For full replacing you can copy this code:

```javascript
Jodit.make('#editor', {
	getIcon: function (name, clearName) {
		let code = clearName;

		switch (clearName) {
			case 'redo':
				code = 'rotate-right';
				break;

			case 'video':
				code = 'video-camera';
				break;

			case 'copyformat':
				code = 'clone';
				break;

			case 'about':
				code = 'question';
				break;

			case 'selectall':
				code = 'legal';
				break;

			case 'symbol':
				return '<span style="text-align: center;font-size:14px;">Ω</span>';

			case 'hr':
				code = 'minus';
				break;

			case 'left':
			case 'right':
			case 'justify':
			case 'center':
				code = 'align-' + name;
				break;

			case 'brush':
				code = 'tint';
				break;

			case 'fontsize':
				code = 'text-height';
				break;

			case 'ul':
			case 'ol':
				code = 'list-' + name;
				break;

			case 'source':
				code = 'code';
				break;
		}

		return (
			'<i style="font-size:14px" class="fa fa-' + code + ' fa-xs"></i>'
		);
	}
});
```

### Result

```html
<!-- Example Start -->
<link
	rel="stylesheet"
	href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"
/>
<textarea id="editor">Some text</textarea>
<script>
	Jodit.make('#editor', {
		getIcon: function (name, clearName) {
			let code = clearName;

			switch (clearName) {
				case 'redo':
					code = 'rotate-right';
					break;
				case 'video':
					code = 'video-camera';
					break;
				case 'copyformat':
					code = 'clone';
					break;
				case 'about':
					code = 'question';
					break;
				case 'selectall':
					code = 'legal';
					break;
				case 'symbol':
					return '<span style="text-align: center;font-size:14px;">Ω</span>';
				case 'hr':
					code = 'minus';
					break;
				case 'left':
				case 'right':
				case 'justify':
				case 'center':
					code = 'align-' + name;
					break;
				case 'brush':
					code = 'tint';
					break;
				case 'fontsize':
					code = 'text-height';
					break;
				case 'ul':
				case 'ol':
					code = 'list-' + name;
					break;
				case 'source':
					code = 'code';
					break;
			}

			return (
				'<i style="font-size:14px" class="fa fa-' +
				code +
				' fa-xs"></i>'
			);
		}
	});
</script>
<!-- Example End -->
```
