Renders an avatar component with optional file upload.
| 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 | |
droplistAttributes | Record.<string, any> | <optional> | Custom attributes for the droplist component | |
droplistClasses | string | | <optional> | Custom classes for the droplist component | |
hasActions | boolean | <optional> | false | Whether to show the actions droplist |
hasBorder | boolean | <optional> | false | Whether the avatar has a border |
hasUpload | boolean | <optional> | false | Whether to show the file upload |
hideInitials | boolean | <optional> | false | Whether to hide the initials |
hideLogo | boolean | <optional> | false | Whether to hide the logo |
hideNoImageIcon | boolean | <optional> | false | Whether to show the no image icon in the background. |
i18n | Record.<string, any> | <optional> | The i18n strings for the component | |
id | string | <optional> | '' | The ID of the component |
imageFile | string | <optional> | '' | The image file for the avatar |
initials | string | <optional> | '' | The initials 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 |
selectButtonAttributes | Record.<string, any> | <optional> | Custom attributes for the select button | |
size | '2xs' | | <optional> | 'lg' | The size of the avatar |
spacing | string | | <optional> | '' | The spacing for the component |
uploadButtonAttributes | Record.<string, any> | <optional> | Custom attributes for the upload button | |
ref | React.RefObject.<HTMLElement> | | Ref to the component |
- Since
- 5.4.6
- Source
The avatar component.
- Type:
- JSX.
Element
import Avatar from '@gravityforms/components/react/admin/modules/Avatar';
return (
<Avatar>
{ 'children' }
</Avatar>
);