logo

Avatar

Avatars can be used to represent people or objects. It supports images, Icons, or letters.

Examples

Three sizes and two shapes are available.

expand code expand code

For letter type Avatar, when the letters are too long to display, the font size can be automatically adjusted according to the width of the Avatar.

expand code expand code

Avatar group display.

expand code expand code

Image, Icon and letter are supported, and the latter two kinds avatar can have custom colors and background colors.

expand code expand code

Usually used for messages remind.

expand code expand code

Avatar API#

Property Description Type Default Value
ChildContent ParameterContent to display inside avatar shape. Takes priority over AntDesign.Avatar.Text RenderFragment --
Shape ParameterShape of the avatar String AvatarShape.Circle
Size ParameterSize of the avatar. See AntSizeLDSType for possible values. String default
Text ParameterText string to display in the avatar. Typical use is for displaying initials. String --
Src ParameterImage src for the avatar. If this fails to load, AntDesign.Avatar.Icon and AntDesign.Avatar.ChildContent/AntDesign.Avatar.Text will continue to show. String --
SrcSet ParameterA list of sources to use for different screen resolutions. Passed straight to the img tag. String --
Alt ParameterAlternate text for the image String --
Icon ParameterIcon to display String --
OnError ParameterCallback executed when image passed to AntDesign.Avatar.Src fails to load EventCallback<ErrorEventArgs> --
Id ParameterID for the component's HTML String Uniquely Generated ID
Class ParameterSpecifies one or more class names for an DOM element. String --
Style ParameterSpecifies an inline style for a DOM element. String --
RefBack ParameterA ForwardRef instance. You can get a reference to the internal DOM by using AntDesign.ForwardRef.Current. ForwardRef --

AvatarGroup API#

Property Description Type Default Value
ChildContent ParameterThe child content RenderFragment --
MaxCount ParameterMax avatars to show Int32 --
MaxStyle ParameterThe style of excess avatar style String --
MaxPopoverPlacement ParameterThe placement of excess avatar Popover Placement --
Id ParameterID for the component's HTML String Uniquely Generated ID
Class ParameterSpecifies one or more class names for an DOM element. String --
Style ParameterSpecifies an inline style for a DOM element. String --
RefBack ParameterA ForwardRef instance. You can get a reference to the internal DOM by using AntDesign.ForwardRef.Current. ForwardRef --
Upload Badge
文档已更新,请点击 此处 更新。
A new version of this app is available. Click here to update.