Participate in the WeaveFox "AI Artist" contest to win SEE Conf tickets and thousands of prizes

logoAnt Design X

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

FileCard

Display files in the form of cards.
loading

When To Use

  • Used to display files during conversations or input.

Examples

API

Common props ref:Common props

FileCardProps

PropertyDescriptionTypeDefaultVersion
nameFile namestring--
byteFile size (bytes)number--
sizeCard size'small' | 'default''default'-
descriptionFile descriptionReact.ReactNode--
loadingLoading statebooleanfalse-
typeFile type'file' | 'image' | 'audio' | 'video' | string--
srcImage or file URLstring--
maskMask contentReact.ReactNode--
iconCustom iconReact.ReactNode | PresetIcons--
imagePropsImage props configurationImage--
videoPropsVideo props configurationPartial<React.JSX.IntrinsicElements['video']>--
audioPropsAudio props configurationPartial<React.JSX.IntrinsicElements['audio']>--
spinPropsLoading animation props configurationSpinProps & { showText?: boolean; icon?: React.ReactNode }--
onClickClick event callback() => void--

PresetIcons

Preset icon types, supports the following values:

typescript
type PresetIcons =
| 'default' // Default file icon
| 'excel' // Excel file icon
| 'image' // Image file icon
| 'markdown' // Markdown file icon
| 'pdf' // PDF file icon
| 'ppt' // PowerPoint file icon
| 'word' // Word file icon
| 'zip' // Archive file icon
| 'video' // Video file icon
| 'audio' // Audio file icon
| 'java' // Java file icon
| 'javascript' // JavaScript file icon
| 'python'; // Python file icon

FileCard.List

File list component for displaying multiple file cards.

PropertyDescriptionTypeDefaultVersion
itemsFile list dataFileCardProps[]--
sizeCard size'small' | 'default''default'-
removableWhether removableboolean | ((item: FileCardProps) => boolean)false-
onRemoveRemove event callback(item: FileCardProps) => void--
extensionExtension contentReact.ReactNode--
overflowOverflow display style'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

Image\File card.

CodeSandbox Icon
codepen icon
External Link Icon
expand codeexpand code
Image Load

Can use loading,Image、Spin 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
image-file.png
image-file.png
1 KB
0%
Image placeholder
0%
Image placeholder
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