Iconify for Ember function: iconExists

This tutorial is part of Iconify for Ember functions tutorial.

Function iconExists() checks if icon data is available for rendering.

Usage

Function has the following parameter:

  • name, string. Icon name.

Function returns boolean value: true if icon is available, false if icon is not available.

Example

import { iconExists } from '@iconify/ember/components/iconify-icon';

const icon = 'bi:arrow-left';
console.log(`Is ${icon} available?`, iconExists(icon) ? 'yes' : 'no');