Skip to main content

File Preview

Preview different type of files.

Default file preview#

When there is no extension or not supported extension file then it'll go as default.

/fileUrl
<>
<FilePreview fileUrl="/fileUrl" />
</>

File preview#

Declare file url by fileUrl prop.

docxFile.docx
<>
<FilePreview fileUrl="docxFile.docx" />
</>

Add name instead of file url by fileName prop.

xlsxFile
<>
<FilePreview fileUrl="xlsxFile.xlsx" fileName="xlsxFile" />
</>

File extention name is displayed in front of blank page icon.

zipFile.zip
<>
<FilePreview fileUrl="zipFile.zip" />
</>

Picture and Video preview#

Preview jpeg, jpg, gif, png of extension picures and mp4 video.

https://erxes.io/static/images/logo/logo_dark_3x.png
<>
<FilePreview fileUrl="https://erxes.io/static/images/logo/logo_dark_3x.png" />
</>
<>
<FilePreview fileUrl="video.mp4" />
</>

API#

import FilePreview from "erxes-ui/lib/components/FilePreview";

* required prop

NameTypeDefaultDescription
fileUrl*stringDefine url of file. Supported types: docx, pptx, xlsx, mp4, jpeg, jpg, gif, png, zip, csv, doc, ppt, psd, avi, txt, rar, mp3, pdf, xls
fileNamestringShow file name instead of the url
Last updated on by enkhzule