Avatar - Ant Design
Maybe your like
- Components Overview
- Changelogv6.1.2
- General
- Button
- FloatButton
- Icon
- Typography
- Layout
- Divider
- Flex
- Grid
- Layout
- Masonry6.0.0
- Space
- Splitter
- Navigation
- Anchor
- Breadcrumb
- Dropdown
- Menu
- Pagination
- Steps
- Tabs
- Data Entry
- AutoComplete
- Cascader
- Checkbox
- ColorPicker
- DatePicker
- Form
- Input
- InputNumber
- Mentions
- Radio
- Rate
- Select
- Slider
- Switch
- TimePicker
- Transfer
- TreeSelect
- Upload
- Data Display
- Avatar
- Badge
- Calendar
- Card
- Carousel
- Collapse
- Descriptions
- Empty
- Image
- ListDEPRECATED
- Popover
- QRCode
- Segmented
- Statistic
- Table
- Tag
- Timeline
- Tooltip
- Tour
- Tree
- Feedback
- Alert
- Drawer
- Message
- Modal
- Notification
- Popconfirm
- Progress
- Result
- Skeleton
- Spin
- Watermark
- Other
- Affix
- App
- ConfigProvider
- Util
| Importimport { Avatar } from 'antd'; |
| GitHubcomponents/avatarIssueOpen issues |
| DocsEdit this page |
Examples
API
Common props ref:Common props
Avatar
| Property | Description | Type | Default | Version |
|---|---|---|---|---|
| alt | This attribute defines the alternative text describing the image | string | - | |
| gap | Letter type unit distance between left and right sides | number | 4 | 4.3.0 |
| icon | Custom icon type for an icon avatar | ReactNode | - | |
| shape | The shape of avatar | circle | square | circle | |
| size | The size of the avatar | number | large | small | default | { xs: number, sm: number, ...} | default | 4.7.0 |
| src | The address of the image for an image avatar or image element | string | ReactNode | - | ReactNode: 4.8.0 |
| srcSet | A list of sources to use for different screen resolutions | string | - | |
| draggable | Whether the picture is allowed to be dragged | boolean | 'true' | 'false' | true | |
| crossOrigin | CORS settings attributes | 'anonymous' | 'use-credentials' | '' | - | 4.17.0 |
| onError | Handler when img load error, return false to prevent default fallback behavior | () => boolean | - |
Tip: You can set icon or children as the fallback for image load error, with the priority of icon > children
Avatar.Group 4.5.0+
| Property | Description | Type | Default | Version |
|---|---|---|---|---|
| max | Set maximum display related configurations, Before 5.18.0 you can use parameters | { count?: number; style?: CSSProperties; popover?: PopoverProps } | - | 5.18.0 |
| size | The size of the avatar | number | large | small | default | { xs: number, sm: number, ...} | default | 4.8.0 |
| shape | The shape of the avatar | circle | square | circle | 5.8.0 |
Design Token
Component TokenHow to use?| Token Name | Description | Type | Default Value |
|---|---|---|---|
| containerSize | Size of Avatar | number | 32 |
| containerSizeLG | Size of large Avatar | number | 40 |
| containerSizeSM | Size of small Avatar | number | 24 |
| groupBorderColor | Border color of avatars in a group | string | #ffffff |
| groupOverlapping | Overlapping of avatars in a group | number | -8 |
| groupSpace | Spacing between avatars in a group | number | 4 |
| iconFontSize | Font size of Avatar icon | number | 18 |
| iconFontSizeLG | Font size of large Avatar icon | number | 24 |
| iconFontSizeSM | Font size of small Avatar icon | number | 14 |
| textFontSize | Font size of Avatar | number | 14 |
| textFontSizeLG | Font size of large Avatar | number | 14 |
| textFontSizeSM | Font size of small Avatar | number | 14 |
Three sizes and two shapes are available.
CodeSandbox IconHitu Iconcodepen iconExternal Link IconExpand IconAutoset Font SizeFor 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. You can also use gap to set the unit distance between left and right sides.
CodeSandbox IconHitu Iconcodepen iconExternal Link IconExpand IconAvatar.GroupAvatar group display.
CodeSandbox IconHitu Iconcodepen iconExternal Link IconExpand IconTypeImage, Icon and letter are supported, and the latter two kinds of avatar can have custom colors and background colors.
CodeSandbox IconHitu Iconcodepen iconExternal Link IconExpand IconWith BadgeUsually used for reminders and notifications.
CodeSandbox IconHitu Iconcodepen iconExternal Link IconExpand IconResponsive SizeAvatar size can be automatically adjusted based on the screen size.
CodeSandbox IconHitu Iconcodepen iconExternal Link IconExpand IconUChangeUserchangeGap
K+2AKUUSERTag » What Is An Avatar Icon
-
Avatar (computing) - Wikipedia
-
What Is The Difference Between An ICON And An Avatar? - Quora
-
What Is An Avatar? - Definition From Techopedia
-
Avatar Icons & Symbols - Flaticon
-
Avatar | Components - BootstrapVue
-
Avatar Icon Images | Free Vectors, Stock Photos & PSD - Freepik
-
Hi, What's The Difference Between An "avatar", "a Profile Photo/picture ...
-
1,025,131 Avatar Icon Images, Stock Photos & Vectors | Shutterstock
-
110,418 Avatar Icons - Free In SVG, PNG, ICO - IconScout
-
Ion-avatar: Circular Application Avatar Icon Component
-
Avatar Icons – Download For Free In PNG And SVG - Icons8
-
Avatar Icons - Pinterest
-
Avatar Icon Vector Art, Icons, And Graphics For Free Download