@ra-libs/react
  • CHANGELOG
  • README
  • Home
    • Table of contents
    • common
      • Countries
      • Currencies
    • components
      • Datagrid
      • ResponsiveDatagrid
      • Fields
        • BooleanField
        • ChipField
        • CountryField
        • CurrencyField
        • DateField
        • FileViewerField
        • MaskedNumberField
        • PhoneField
        • ReferenceArrayField
        • ReferenceField
        • RichTextField
        • SelectField
        • TextField
        • TimeField
        • TimelineArrayField
        • TimezoneField
        • TzDateField
        • TzTimeField
      • Inputs
        • CountryInput
        • CurrencyInput
        • DateInput
        • MapsInput
        • MaskedNumberInput
        • MaskedTextInput
        • PhoneInput
        • PlacesTimelineInput
        • TimeInput
        • TimezoneInput
        • TzDateInput
        • TzTimeInput
    • hooks
      • useCountries
      • useCurrencies
      • useScreenSize
    • providers
      • DataProvider
    • services
      • HttpRequest
      • LocalSession
    • validations
      • maxYear
      • minYear
Powered by GitBook
On this page
  • Usage
  • Props
Edit on GitHub
  1. Home
  2. components
  3. Fields

FileViewerField

PreviousDateFieldNextMaskedNumberField

Last updated 1 year ago

Render PDF or Image files in material ui

This component uses 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

Prop
Required
Type
Default
Description

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.

Dialog
PDFjs