logoAnt Design X

DesignDevelopmentComponentsX MarkdownX SDKPlayground
  • Introduction
  • Overview
  • Common
    • Bubble
    • Conversations
    • Notification
  • Confirmation
    • Think
    • ThoughtChain
  • Wake
    • Welcome
    • Prompts
  • Express
    • Attachments
    • Sender
    • Suggestion
  • Feedback
    • Actions
    • FileCard
  • Others
    • XProvider

FileCard

Display files in the form of cards.

Resources

Ant Design
Ant Design Charts
Ant Design Pro
Pro Components
Ant Design Mobile
Ant Design Mini
Ant Design Web3
Ant Design Landing-Landing Templates
Scaffolds-Scaffold Market
Umi-React Application Framework
dumi-Component doc generator
qiankun-Micro-Frontends Framework
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

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

When To Use

Used to display files during conversations or input.

Examples

API

Common props ref:Common props

ThinkProps

PropertyDescriptionTypeDefaultVersion
classNamesDOM classRecord<SemanticDOM, string>--
stylesDOM styleRecord<SemanticDOM, CSSProperties>--
nameFile namestring--
byteFile sizenumber | string--
descriptionFile descriptionReactNode--
typeFile type'file' | 'image' | 'audio' | 'video'--
srclink of image or filestring--
maskCustom maskReactNode--
iconCustom iconReact.ReactNode | PresetIcons--
onClickCallback when click() => void--
sizeShow card size'small' | 'default'default-
typescript
type PresetIcons =
| 'default'
| 'excel'
| 'image'
| 'markdown'
| 'pdf'
| 'ppt'
| 'word'
| 'zip'
| 'video'
| 'audio'
| 'java'
| 'javascript'
| 'python';

FileCard.List

PropertyDescriptionTypeDefaultVersion
itemsFile listsFileCardProps[]--
sizeCard size'small' | 'default'default-
removableCan be removedboolean | ((item: FileCardProps) => boolean)false-
onRemoveCallback when remove(item: FileCardProps, list?: FileCardProps[]) => void--
extensionShow extensionReact.ReactNode--
overflowStyle when overflow'scrollX' | 'scrollY' | 'wrap'wrap-

Semantic DOM

FileCard

FileCard.List

主题变量(Design Token)

Global TokenHow to use?
Basic

Basic usage.

CodeSandbox Icon
codepen icon
External Link Icon
expand codeexpand code
Size

Different sizes of cards.

CodeSandbox Icon
codepen icon
External Link Icon
expand codeexpand code
Image

Can use Image props.

CodeSandbox Icon
codepen icon
External Link Icon
expand codeexpand code
Audio/Video

Use browser native tags.

CodeSandbox Icon
codepen icon
External Link Icon
expand codeexpand code
Mask

Custom mask.

CodeSandbox Icon
codepen icon
External Link Icon
expand codeexpand code
Icon

you can use built-in icons or custom.

CodeSandbox Icon
codepen icon
External Link Icon
expand codeexpand code
List

Use list to show multiple file cards.

CodeSandbox Icon
codepen icon
External Link Icon
expand codeexpand code
Overflow

Controls the layout of attachments when they exceed the area.

CodeSandbox Icon
codepen icon
External Link Icon
expand codeexpand code
excel-has-long-long-long-name.xlsx
1 KB
word-file.docx
1 KB
pdf-file.pdf
1 KB
ppt-file.pptx
1 KB
zip-file.zip
1 KB
txt-file.txt
1 KB
markdown-file.md
1 KB
java-file.java
1 KB
javascript-file.js
1 KB
python-file.py
1 KB
excel-file.xlsx
1 KB
pdf-file.pdf
1 KB
pdf-file.pdf
1 KB
image-file.png
Preview
image-file.png
Preview
image-file.png
1 KB
audio-file.mp3
1 KB
video-file.mp4
1 KB
txt-file.txt
1 KB
txt-file.txt
1 KB
android-file.apk
1 KB
pdf-file.pdf
1 KB
  • root
    Root
  • file
    File
  • icon
    Icon
  • name
    Name
  • description
    Description
  • root
    Root
  • card
    Card
  • file
    File
  • icon
    Icon
  • name
    Name
  • description
    Description