mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-16 01:41:02 +08:00
882cec62d6
* docs: Add components overview page * fix detail * remove ContributorsList form overview page * fix components url * improve code style * remove extra file * fix detail * fix lint * fix lint * docs: Finish components overview page * fix lint * docs: Update cover * fix lint * update cover * update menu * improve overview page * refactor code * fix order * update title * add components count * fix overview page ssr bug * move less file * update title margin Co-authored-by: arvinxx <arvinx@foxmail.com>
27 lines
1.0 KiB
Markdown
27 lines
1.0 KiB
Markdown
---
|
|
category: Components
|
|
subtitle: 头像
|
|
type: 数据展示
|
|
title: Avatar
|
|
cover: https://gw.alipayobjects.com/zos/antfincdn/aBcnbw68hP/Avatar.svg
|
|
---
|
|
|
|
用来代表用户或事物,支持图片、图标或字符展示。
|
|
|
|
## 设计师专属
|
|
|
|
安装 [Kitchen Sketch 插件 💎](https://kitchen.alipay.com),一键填充高逼格头像和文本.
|
|
|
|
## API
|
|
|
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
|
| --- | --- | --- | --- | --- |
|
|
| icon | 设置头像的自定义图标 | ReactNode | - | |
|
|
| shape | 指定头像的形状 | `circle` \| `square` | `circle` | |
|
|
| size | 设置头像的大小 | number \| `large` \| `small` \| `default` | `default` | |
|
|
| src | 图片类头像的资源地址 | string | - | |
|
|
| srcSet | 设置图片类头像响应式资源地址 | string | - | |
|
|
| alt | 图像无法显示时的替代文本 | string | - | |
|
|
| onError | 图片加载失败的事件,返回 false 会关闭组件默认的 fallback 行为 | () => boolean | - | |
|
|
| gap | 字符类型距离左右两侧边界单位像素 | number | 4 | 4.3.0 |
|