# ghostkit/3.3.2/gutenberg/utils/get-icon/index.js

Block Animations, Motion &amp; Scroll Effects – Ghost Kit, version 3.3.2. 19 lines.

- Page: https://pluginprobe.com/plugins/ghostkit/3.3.2/code/gutenberg/utils/get-icon/index.js
- Raw: https://pluginprobe.com/plugins/ghostkit/3.3.2/raw/gutenberg/utils/get-icon/index.js
- Modified: 2024-02-18T18:40:24+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/ghostkit/3.3.2/code/gutenberg/utils/get-icon/index.js#L10-L20`.

```javascript
import allIcons from '../../icons/index';

export default function getIcon(icon, returnObject) {
	if (icon && typeof allIcons[icon] !== 'undefined') {
		// return object for block registration.
		if (returnObject) {
			return {
				foreground: '#7d7cbf',
				src: allIcons[icon],
			};
		}

		// return icon.
		return allIcons[icon]();
	}

	return '';
}

```
