Renders an avatar component with optional file upload.

Parameters:
NameTypeAttributesDefaultDescription
childrenReact.ReactNode | Array.<React.ReactNode><optional>

React element children

customAttributesRecord.<string, any><optional>

Custom attributes for the component

customClassesstring | Array.<string> | Record.<string, boolean><optional>

Custom classes for the component

fileUploadPropsRecord.<string, any><optional>

Props for the file upload component

hasUploadboolean<optional>
false

Whether to show the upload button

hideNoImageIconboolean<optional>
false

Whether to show the no image icon in the background.

hideLogoboolean<optional>
false

Whether to hide the logo

imageFilestring<optional>
''

The image file for the avatar

LogoReact.ComponentType<optional>
null

The logo component

noImageIconstring<optional>
'user'

The icon to show when no image is present

noImageIconPrefixstring<optional>
'gravity-component-icon'

The icon prefix

size'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl'<optional>
'lg'

The size of the avatar

spacingstring | number | Array.<string> | Record.<string, any><optional>
''

The spacing for the component

refReact.RefObject.<HTMLElement> | null

Ref to the component

Since
  • 5.4.6
Returns:

The avatar component.

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

return (
    <Avatar>
        { 'children' }
    </Avatar>
);