FileCard
Display files in the form of cards.
When to use
- Used to display files during conversation or input.
Examples
Basic usage
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
Card size
pdf-file.pdf
1 KB
pdf-file.pdf
1 KB
Image files

Preview

Preview
image-file.png
1 KB
Image loading
0%
0%
Audio and video
audio-file.mp3
1 KB
video-file.mp4
1 KB
Overlay mask
txt-file.txt
1 KB
Custom icon
txt-file.txt
1 KB
android-file.apk
1 KB
File list
excel-file.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
excel-file.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

Preview

Preview

Preview

Preview

Preview

Preview

Preview

Preview

Preview
Overflow style

Preview

Preview

Preview

Preview

Preview

Preview

Preview

Preview

Preview

Preview

Preview
excel-file.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
API
FileCardProps
| Prop | Description | Type | Default | Version |
|---|---|---|---|---|
| name | File Name | string | - | - |
| byte | File size (bytes) | number | - | - |
| size | Card Size | 'small' | 'default' | 'default' | - |
| description | Document Description | VNode | string | - | - |
| loading | Is it in loaded mode | boolean | false | - |
| type | File Type | 'file' | 'image' | 'audio' | 'video' | string | - | - |
| src | Image or File Address | string | - | - |
| mask | Mask Content | VNode | string | - | - |
| icon | Custom icon | VNode | PresetIcons | - |
| imageProps | Image properties, same as ant-design-vue Image properties | ImageProps | - | - |
| videoProps | Video Attribute Configuration | Record<string, any> | - | - |
| audioProps | Audio Attribute Configuration | Record<string, any> | - | - |
| spinProps | Loading Properties | [SpinProps] (https://www.antdv.com/components/spin-cn#api) & { showText?: boolean; icon?: VNode } | - | - |
| onClick | Click event callback | () => void | - | - |
PresetIcons
Preset icon types, supporting the following values:
typescript
type PresetIcons =
| 'default' // 默认文件图标
| 'excel' // Excel 文件图标
| 'image' // 图片文件图标
| 'markdown' // Markdown 文件图标
| 'pdf' // PDF 文件图标
| 'ppt' // PowerPoint 文件图标
| 'word' // Word 文件图标
| 'zip' // 压缩文件图标
| 'video' // 视频文件图标
| 'audio' // 音频文件图标
| 'java' // Java 文件图标
| 'javascript' // JavaScript 文件图标
| 'python'; // Python 文件图标FileCard.List
File list component, used to display multiple file cards.
| Prop | Description | Type | Default | Version |
|---|---|---|---|---|
| items | File list data. Each item is FileCardProps, and key can be used as a stable identifier; defaults to name-index if missing | (FileCardProps & { key?: string | number })[] | - |
| size | Card Size | 'small' | 'default' | 'default' | - |
| removable | Whether it can be deleted | boolean | ((item: FileCardProps) => boolean) | false |
| onRemove | Remove event callback | (item: FileCardProps) => void | - | - |
| extension | Extended content | VNode | - | - |
| overflow | Overflow display method | 'scrollX' | 'scrollY' | 'wrap' |
Semantic DOM
pdf-file.pdf
1 KB
root
根节点file
文件icon
图标name
名称description
描述
excel-file.xlsx
1 KB
excel-file.xlsx
1 KB
excel-file.xlsx
1 KB
root
根节点card
卡片file
文件icon
图标name
名称description
描述
Design Token
This component has no custom Component Token. Customize it through global Design Tokens.