FileViewerField

Render PDF or Image files in material ui Dialog

This component uses PDFjs make sure to download PDFjs files and add them to the public folder with the folder name pdfjs Make sure to update the HOSTED_VIEWER_ORIGINS variable in viewer.js to add your frontend domains

Usage

import { FileViewerField } from '@ra-libs/react';

<FileViewerField source="<source>" typeSource="mimeType" title="fileTitle" useLabel />;

it renders a button with the file title name

Props

PropRequiredTypeDefaultDescription

useLabel

false

boolean

false

whether to use react-admin Labeled component or not.

typeSource

false

string

-

the file mimeType source to find in record. if ommitted the component will render the default react-admin FileField component.

title

false

string

file

the file title/name.

Last updated