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.

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

File preview

Declare file url by fileUrl prop.

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

Add name instead of file url by fileName prop.

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

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

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

Picture and Video preview

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

<>
	<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

Was this page helpful?