0.0.24 • Published 1 year ago

react-doc-previewer v0.0.24

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

React Doc Previewer

React Doc Previewer is a versatile React component library designed to facilitate the previewing of various image and pdf formats within your React applications.

Features

Pdf Preview: Display previews for pdf documents. Image Preview: Preview images in various formats such as JPEG, PNG . Responsive: Ensures a responsive viewing experience across devices.

Installation

You can install the package via npm or yarn:

npm i react-doc-previewer

Usage

  const [show, setShow] = useState(false)
  const [document, setDocument] = useState({ url: IMAGE_URL, type: "image" });
  return (
      <div style={{ position: "relative", width: "100%", height: "100vh", overflow: "hidden" }}>
        <DocPreviewer type={im.type} variant={'full'} url={im.url} show={count} onClose={() => setCount(false)} />
        <button onClick={() => setCount(true)} >show</button>
        <button
          onClick={() => {
            setIm((prev) => (prev.type === "image" ? {
              url: PDF,
              type: "pdf"
            } : {
              url: IMAGE_URL2,
              type: "image"
            }));
          }}
        >
          switch
        </button>
      </div>

Props

Component Props

  • type: image | pdf
  • variant: full | inherit | number, number
  • show: boolean
  • onClose: () => {}
  • url: url of the document

License

This project is licensed under the MIT License.

Contributing

Contributions are welcome! Please feel free to submit a pull request or open an issue for any bugs or feature requests.

0.0.24

1 year ago

0.0.23

1 year ago

0.0.22

1 year ago

0.0.21

1 year ago

0.0.20

1 year ago

0.0.19

1 year ago

0.0.18

1 year ago

0.0.17

1 year ago

0.0.16

1 year ago

0.0.15

1 year ago

0.0.14

1 year ago

0.0.13

1 year ago

0.0.12

1 year ago

0.0.11

1 year ago

0.0.10

1 year ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago

1.0.0

1 year ago