Renders an avatar component with optional file upload.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
children | React. | <optional> | React element children | |
customAttributes | Record.<string, any> | <optional> | Custom attributes for the component | |
customClasses | string | | <optional> | Custom classes for the component | |
fileUploadProps | Record.<string, any> | <optional> | Props for the file upload component | |
hasUpload | boolean | <optional> | false | Whether to show the upload button |
hideNoImageIcon | boolean | <optional> | false | Whether to show the no image icon in the background. |
hideLogo | boolean | <optional> | false | Whether to hide the logo |
imageFile | string | <optional> | '' | The image file for the avatar |
Logo | React. | <optional> | null | The logo component |
noImageIcon | string | <optional> | 'user' | The icon to show when no image is present |
noImageIconPrefix | string | <optional> | 'gravity-component-icon' | The icon prefix |
size | 'xs' | | <optional> | 'lg' | The size of the avatar |
spacing | string | | <optional> | '' | The spacing for the component |
ref | React.RefObject.<HTMLElement> | | Ref to the component |
- Since
- 5.4.6
- Source
Returns:
The avatar component.
- Type:
- JSX.
Element
Example
import Avatar from '@gravityforms/components/react/admin/modules/Avatar';
return (
<Avatar>
{ 'children' }
</Avatar>
);