0.1.6 • Published 12 months ago

@magic-gear/file-viewer v0.1.6

Weekly downloads
-
License
-
Repository
github
Last release
12 months ago

@magic-gear/file-viewer

Supported file formats:

  • Images: png, jpg, jpeg, gif, bmp
  • pdf
  • csv
  • xls
  • xlsx
  • docx
  • mp3
  • mp4
  • webm

Getting Started

npm install @magic-gear/file-viewer

Usage

import React from 'react'
import FileViewer from '@magic-gear/file-viewer'
import { CustomErrorComponent } from 'custom-error'

const MyComponent = () => {
  const file = 'http://example.com/image.png'
  const type = 'png'
  const fetchOptions = { headers: { 'app-id': 'abc123' } }

  return (
    <FileViewer
      fileType={type}
      fileUrl={file}
      requestOptions={fetchOptions}
      errorComponent={CustomErrorComponent}
    />
  )
}

export default MyComponent
0.1.6

12 months ago

0.1.5

12 months ago

0.1.4

12 months ago

0.1.3

12 months ago

0.1.2

12 months ago

0.1.1

12 months ago

0.1.0

12 months ago