logoAnt Design

⌘ K
  • 设计
  • 研发
  • 组件
  • 博客
  • 资源
  • 国内镜像
5.20.6
  • 组件总览
  • 通用
    • Button
      按钮
    • FloatButton
      悬浮按钮
      5.0.0
    • Icon
      图标
    • Typography
      排版
  • 布局
    • Divider
      分割线
    • Flex
      弹性布局
      5.10.0
    • Grid
      栅格
    • Layout
      布局
    • Space
      间距
  • 导航
    • Anchor
      锚点
    • Breadcrumb
      面包屑
    • Dropdown
      下拉菜单
    • Menu
      导航菜单
    • Pagination
      分页
    • Steps
      步骤条
  • 数据录入
    • AutoComplete
      自动完成
    • Cascader
      级联选择
    • Checkbox
      多选框
    • ColorPicker
      颜色选择器
      5.5.0
    • DatePicker
      日期选择框
    • Form
      表单
    • Input
      输入框
    • InputNumber
      数字输入框
    • Mentions
      提及
    • Radio
      单选框
    • Rate
      评分
    • Select
      选择器
    • Slider
      滑动输入条
    • Switch
      开关
    • TimePicker
      时间选择框
    • Transfer
      穿梭框
    • TreeSelect
      树选择
    • Upload
      上传
  • 数据展示
    • 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
      树形控件
  • 反馈
    • Alert
      警告提示
    • Drawer
      抽屉
    • Message
      全局提示
    • Modal
      对话框
    • Notification
      通知提醒框
    • Popconfirm
      气泡确认框
    • Progress
      进度条
    • Result
      结果
    • Skeleton
      骨架屏
    • Spin
      加载中
    • Watermark
      水印
      5.1.0
  • 其他
    • Affix
      固钉
    • App
      包裹组件
      5.1.0
    • ConfigProvider
      全局化配置
    • Util
      工具类
      5.13.0

List
列表

最基础的列表展示,可承载文字、列表、图片、段落。
使用import{ List }from"antd";
源码components/list
文档编辑此页

相关资源

Ant Design Charts
Ant Design Pro
Ant Design Pro Components
Ant Design Mobile
Ant Design Mini
Ant Design Landing-首页模板集
Scaffolds-脚手架市场
Umi-React 应用开发框架
dumi-组件/文档研发工具
qiankun-微前端框架
ahooks-React Hooks 库
Ant Motion-设计动效
国内镜像站点 🇨🇳

社区

Awesome Ant Design
Medium
Twitter
yuque logoAnt Design 语雀专栏
Ant Design 知乎专栏
体验科技专栏
seeconf logoSEE Conf-蚂蚁体验科技大会
加入我们

帮助

GitHub
更新日志
常见问题
报告 Bug
议题
讨论区
StackOverflow
SegmentFault

Ant XTech logo更多产品

yuque logo语雀-构建你的数字花园
AntV logoAntV-数据可视化解决方案
Egg logoEgg-企业级 Node.js 框架
Kitchen logoKitchen-Sketch 工具集
Galacean logoGalacean-互动图形解决方案
xtech logo蚂蚁体验科技
主题编辑器
Made with ❤ by
蚂蚁集团和 Ant Design 开源社区
loading

何时使用

最基础的列表展示,可承载文字、列表、图片、段落,常用于后台数据展示页面。

代码演示

Default Size
Header
  • [ITEM] Racing car sprays burning fuel into crowd.
  • [ITEM] Japanese princess to wed commoner.
  • [ITEM] Australian walks 100km after outback crash.
  • [ITEM] Man charged over missing wedding girl.
  • [ITEM] Los Angeles battles huge wildfires.
Footer
Small Size
Header
  • Racing car sprays burning fuel into crowd.
  • Japanese princess to wed commoner.
  • Australian walks 100km after outback crash.
  • Man charged over missing wedding girl.
  • Los Angeles battles huge wildfires.
Footer
Large Size
Header
  • Racing car sprays burning fuel into crowd.
  • Japanese princess to wed commoner.
  • Australian walks 100km after outback crash.
  • Man charged over missing wedding girl.
  • Los Angeles battles huge wildfires.
Footer
简单列表

列表拥有大、中、小三种尺寸。

通过设置 size 为 large small 分别把按钮设为大、小尺寸。若不设置 size,则尺寸为中。

可通过设置 header 和 footer,来自定义列表头部和尾部。

codepen icon
External Link Icon
expand codeexpand code
  • Ant Design Title 1

    Ant Design, a design language for background applications, is refined by Ant UED Team
  • Ant Design Title 2

    Ant Design, a design language for background applications, is refined by Ant UED Team
  • Ant Design Title 3

    Ant Design, a design language for background applications, is refined by Ant UED Team
  • Ant Design Title 4

    Ant Design, a design language for background applications, is refined by Ant UED Team
基础列表

基础列表。

codepen icon
External Link Icon
expand codeexpand code
加载更多

可通过 loadMore 属性实现加载更多功能。

codepen icon
External Link Icon
expand codeexpand code
  • ant design part 0

    Ant Design, a design language for background applications, is refined by Ant UED Team.
    We supply a series of design principles, practical patterns and high quality design resources (Sketch and Axure), to help people create their product prototypes beautifully and efficiently.
    • 156
    • 156
    • 2
    logo
  • ant design part 1

    Ant Design, a design language for background applications, is refined by Ant UED Team.
    We supply a series of design principles, practical patterns and high quality design resources (Sketch and Axure), to help people create their product prototypes beautifully and efficiently.
    • 156
    • 156
    • 2
    logo
  • ant design part 2

    Ant Design, a design language for background applications, is refined by Ant UED Team.
    We supply a series of design principles, practical patterns and high quality design resources (Sketch and Axure), to help people create their product prototypes beautifully and efficiently.
    • 156
    • 156
    • 2
    logo
ant design footer part
  • 1
  • 2
  • 3
  • 4
  • 5
  • •••
  • 8
竖排列表样式

通过设置 itemLayout 属性为 vertical 可实现竖排列表样式。

codepen icon
External Link Icon
expand codeexpand code
Pagination Position:
Pagination Align:
  • Ant Design Title 1

    Ant Design, a design language for background applications, is refined by Ant UED Team
  • Ant Design Title 2

    Ant Design, a design language for background applications, is refined by Ant UED Team
  • Ant Design Title 3

    Ant Design, a design language for background applications, is refined by Ant UED Team
  • Ant Design Title 4

    Ant Design, a design language for background applications, is refined by Ant UED Team
  • 1
分页设置

可通过 pagination 属性使用列表分页,并进行设置。

codepen icon
External Link Icon
expand codeexpand code
Title 1
Card content
Title 2
Card content
Title 3
Card content
Title 4
Card content
栅格列表

可以通过设置 List 的 grid 属性来实现栅格列表,column 可设置期望显示的列数。

codepen icon
External Link Icon
expand codeexpand code
Title 1
Card content
Title 2
Card content
Title 3
Card content
Title 4
Card content
Title 5
Card content
Title 6
Card content
响应式的栅格列表

响应式的栅格列表。尺寸与 Layout Grid 保持一致。

codepen icon
External Link Icon
expand codeexpand code
Simple Empty
暂无数据

滚动加载

结合 react-infinite-scroll-component 实现滚动自动加载列表。

codepen icon
External Link Icon
expand codeexpand code
滚动加载无限长列表

结合 rc-virtual-list 实现滚动加载无限长列表,能够提高数据量大时候长列表的性能。

codepen icon
External Link Icon
expand codeexpand code

API

通用属性参考:通用属性

另外我们封装了 ProList,在 antd List 之上扩展了更多便捷易用的功能,比如多选,展开等功能,使用体验贴近 Table,欢迎尝试使用。

List

参数说明类型默认值版本
bordered是否展示边框booleanfalse
dataSource列表数据源any[]-
footer列表底部ReactNode-
grid列表栅格配置object-
header列表头部ReactNode-
itemLayout设置 List.Item 布局,设置成 vertical 则竖直样式显示,默认横排string-
loading当卡片内容还在加载中时,可以用 loading 展示一个占位boolean | object (更多)false
loadMore加载更多ReactNode-
locale默认文案设置,目前包括空数据文案object{emptyText: 暂无数据}
pagination对应的 pagination 配置,设置 false 不显示boolean | objectfalse
renderItem当使用 dataSource 时,可以用 renderItem 自定义渲染列表项(item) => ReactNode-
rowKey当 renderItem 自定义渲染列表项有效时,自定义每一行的 key 的获取方式keyof T | (item: T) => React.Key"key"
sizelist 的尺寸default | large | smalldefault
split是否展示分割线booleantrue

pagination

分页的配置项。

参数说明类型默认值
position指定分页显示的位置top | bottom | bothbottom
align指定分页对齐的位置start | center | endend

更多配置项,请查看 Pagination。

List grid props

参数说明类型默认值版本
column列数number-
gutter栅格间隔number0
xs<576px 展示的列数number-
sm≥576px 展示的列数number-
md≥768px 展示的列数number-
lg≥992px 展示的列数number-
xl≥1200px 展示的列数number-
xxl≥1600px 展示的列数number-

List.Item

参数说明类型默认值版本
actions列表操作组,根据 itemLayout 的不同,位置在卡片底部或者最右侧Array<ReactNode>-
classNames语义化结构 classNameRecord<actions | extra, string>-5.18.0
extra额外内容,通常用在 itemLayout 为 vertical 的情况下,展示右侧内容; horizontal 展示在列表元素最右侧ReactNode-
styles语义化结构 styleRecord<actions | extra, CSSProperties>-5.18.0

List.Item.Meta

参数说明类型默认值版本
avatar列表元素的图标ReactNode-
description列表元素的描述内容ReactNode-
title列表元素的标题ReactNode-

Semantic DOM

  • ant design part 0

    Ant Design, a design language for background applications, is refined by Ant UED Team.
    We supply a series of design principles, practical patterns and high quality design resources (Sketch and Axure), to help people create their product prototypes beautifully and efficiently.
    • 156
    • 156
    • 2
    logo
  • extra
    5.18.0
    设置额外内容
  • actions
    5.18.0
    设置列表操作组

主题变量(Design Token)

组件 Token如何定制?

Token 名称描述类型默认值
avatarMarginRight头像右间距undefined | MarginRight<string | number>16
contentWidth内容宽度string | number220
descriptionFontSize描述文字大小number14
emptyTextPadding空文本内边距undefined | Padding<string | number>16
footerBg底部区域背景色stringtransparent
headerBg头部区域背景色stringtransparent
itemPadding列表项内间距string12px 0
itemPaddingLG大号列表项内间距string16px 24px
itemPaddingSM小号列表项内间距string8px 16px
metaMarginBottomMeta 下间距undefined | MarginBottom<string | number>16
titleMarginBottom标题下间距undefined | MarginBottom<string | number>12

全局 Token如何定制?