Avatar Upload

Upload an avatar by clicking on them.

Default avatar

Set default avatar with defaultAvatar prop.

<>
	<AvatarUpload defaultAvatar="https://erxes.io/static/images/logo/logo_dark_3x.png" />
</>

Avatar

When you upload an avatar, it shows the avatar instead of default avatar

<>
	<AvatarUpload defaultAvatar="https://erxes.io/static/images/logo/logo_dark_3x.png" avatar="https://erxes.io/static/images/logo/glyph_dark.png" />
</>

API

import AvatarUpload from "erxes-ui/lib/components/AvatarUpload";
  • required prop
NAMETYPEDEFAULTDESCRIPTION
defaultAvatarstringbuttonSet default avatar
avatarstringSet an avatar
onAvatarUploadfunctionDefine function that changes the avatar when the image uploaded

Was this page helpful?