Renders a simple icon component.

Parameters:
NameTypeDescription
propsobject

Component props.

Properties
NameTypeDescription
childrenJSX.Element

React element children.

customAttributesobject

Custom attributes for the component

customClassesstring | Array | object

Custom classes for the component.

iconstring

The name for the icon to use from the icon library specified in iconPrefix.

iconPrefixstring

The prefix for the icon library to be used.

presetstring

The preset for the icon.

spacingstring | number | Array | object

The spacing for the component, as a string, number, array, or object.

refobject | null

Ref to the component.

Since
  • 1.1.15
Returns:

The icon component.

Type: 
JSX.Element
Example
import Icon from '@gravityforms/components/react/admin/elements/Icon';

return <Icon icon="exclamation" iconPrefix="gform-common-icon" />;