logoAnt Design

⌘ K
  • 디자인
  • 개발
  • 컴포넌트
  • 블로그
  • 자료
5.21.3
  • Components Overview
  • General
    • Button
    • FloatButton
      5.0.0
    • Icon
    • Typography
  • Layout
    • Divider
    • Flex
      5.10.0
    • Grid
    • Layout
    • Space
    • Splitter
      5.21.0
  • Navigation
    • Anchor
    • Breadcrumb
    • Dropdown
    • Menu
    • Pagination
    • Steps
  • Data Entry
    • AutoComplete
    • Cascader
    • Checkbox
    • ColorPicker
      5.5.0
    • 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
    • List
    • Popover
    • QRCode
      5.1.0
    • Segmented
    • Statistic
    • Table
    • Tabs
    • Tag
    • Timeline
    • Tooltip
    • Tour
      5.0.0
    • Tree
  • Feedback
    • Alert
    • Drawer
    • Message
    • Modal
    • Notification
    • Popconfirm
    • Progress
    • Result
    • Skeleton
    • Spin
    • Watermark
      5.1.0
  • Other
    • Affix
    • App
      5.1.0
    • ConfigProvider
    • Util
      5.13.0

Avatar

Used to represent users or things, supporting the display of images, icons, or characters.
가져오기import{ Avatar }from"antd";
소스components/avatar
문서
이 페이지 수정변경 로그

Resources

Ant Design Charts
Ant Design Pro
Ant Design Pro Components
Ant Design Mobile
Ant Design Mini
Ant Design Landing-Landing Templates
Scaffolds-Scaffold Market
Umi-React Application Framework
dumi-Component doc generator
qiankun-Micro-Frontends Framework
ahooks-React Hooks Library
Ant Motion-Motion Solution
China Mirror 🇨🇳

Community

Awesome Ant Design
Medium
Twitter
yuque logoAnt Design in YuQue
Ant Design in Zhihu
Experience Cloud Blog
seeconf logoSEE Conf-Experience Tech Conference
Work with Us

Help

GitHub
Change Log
FAQ
Bug Report
Issues
Discussions
StackOverflow
SegmentFault

Ant XTech logoMore Products

yuque logoYuQue-Document Collaboration Platform
AntV logoAntV-Data Visualization
Egg logoEgg-Enterprise Node.js Framework
Kitchen logoKitchen-Sketch Toolkit
Galacean logoGalacean-Interactive Graphics Solution
xtech logoAnt Financial Experience Tech
Theme Editor
Made with ❤ by
Ant Group and Ant Design Community
loading

Examples

API

Common props ref:Common props

Avatar

PropertyDescriptionTypeDefaultVersion
altThis attribute defines the alternative text describing the imagestring-
gapLetter type unit distance between left and right sidesnumber44.3.0
iconCustom icon type for an icon avatarReactNode-
shapeThe shape of avatarcircle | squarecircle
sizeThe size of the avatarnumber | large | small | default | { xs: number, sm: number, ...}default4.7.0
srcThe address of the image for an image avatar or image elementstring | ReactNode-ReactNode: 4.8.0
srcSetA list of sources to use for different screen resolutionsstring-
draggableWhether the picture is allowed to be draggedboolean | 'true' | 'false'true
crossOriginCORS settings attributes'anonymous' | 'use-credentials' | ''-4.17.0
onErrorHandler 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+)

PropertyDescriptionTypeDefaultVersion
maxSet maximum display related configurations, Before 5.18.0 you can use parameters{ count?: number; style?: CSSProperties; popover?: PopoverProps }-5.18.0
sizeThe size of the avatarnumber | large | small | default | { xs: number, sm: number, ...}default4.8.0
shapeThe shape of the avatarcircle | squarecircle5.8.0

Design Token

컴포넌트 토큰어떻게 사용하나요?

토큰 이름설명타입기본값
containerSize头像尺寸number32
containerSizeLG大号头像尺寸number40
containerSizeSM小号头像尺寸number24
groupBorderColor头像组边框颜色string#ffffff
groupOverlapping头像组重叠宽度number-8
groupSpace头像组间距number4
textFontSize头像文字大小number18
textFontSizeLG大号头像文字大小number24
textFontSizeSM小号头像文字大小number14

글로벌 토큰어떻게 사용하나요?

Basic
codepen icon
External Link Icon
expand codeexpand code
Autoset Font Size
codepen icon
External Link Icon
expand codeexpand code
Avatar.Group
codepen icon
External Link Icon
expand codeexpand code
Responsive Size
codepen icon
External Link Icon
expand codeexpand code
Component Token
codepen icon
External Link Icon
expand codeexpand code
Type
codepen icon
External Link Icon
expand codeexpand code
With Badge
codepen icon
External Link Icon
expand codeexpand code
Calculate text style when hiding
codepen icon
External Link Icon
expand codeexpand code
Fallback
codepen icon
External Link Icon
expand codeexpand code
U
K
K+2
K+2
K+2
AK
K+2
1
U
USER
avatar
U
1
Avatar
Avatar