https://github.com/geminidsystems/react-native-quicklook-view
Preview files using QuickLook in react-native. Support for local files via base64 and downloadable files
https://github.com/geminidsystems/react-native-quicklook-view
document file image preview quicklook react-native
Last synced: 8 months ago
JSON representation
Preview files using QuickLook in react-native. Support for local files via base64 and downloadable files
- Host: GitHub
- URL: https://github.com/geminidsystems/react-native-quicklook-view
- Owner: GeminidSystems
- Created: 2020-08-04T20:15:10.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2022-12-09T17:04:50.000Z (about 3 years ago)
- Last Synced: 2025-04-20T23:32:34.509Z (9 months ago)
- Topics: document, file, image, preview, quicklook, react-native
- Language: Swift
- Homepage:
- Size: 35.6 MB
- Stars: 4
- Watchers: 1
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# react-native-quicklook-view
## Supported Versions
| react-native-select-attachment | react-native |
| --- | --- |
| >= 0.0.1 | 0.60+
## Description
`react-native-quicklook-view` allows you to preview images, documents, and other files through BASE64 or file paths, or a URL.
## Getting Started
`$ npm install react-native-select-attachment --save`
#### Android
Not supported in the current release, check back for future releases or create a PR
#### iOS
CocoaPods on iOS needs this extra step
```
$ npx pod-install
```
## Usage
To import into your react app, import the SelectAttachmentButton component.
```javascript
import QuickLookView from 'react-native-quicklook-view';
```
##### Download Example
```javascript
```
##### Base64 Example
```javascript
```
# Reference
## Properties
### `fileID`
A unique identifier for the file
| Type | Required | Default |
| -------- | -------- | -------- |
| String | Yes | None |
---
### `fileSource`
The source of the file. Valid values include:
- DOWNLOAD
- BASE64
| Type | Required | Default |
| -------- | -------- | ----- |
| [String] | Yes | None |
---
### `url`
The URL of the file. This is used only is `fileSource` is set to `DOWNLOAD`
| Type | Required | Default |
| -------- | -------- | ----- |
| String | No | None |
---
### `fileData`
Base64 encoded String of the file data. This is used only if `fileSource` is set to `BASE64`
| Type | Required | Default |
| -------- | -------- | -------- |
| String | No | None |
---
### `fileType`
The file type for Base64 encoded string. Example "png" or "pdf"
| Type | Required | Default |
| -------- | -------- | -------- |
| String | No | false |
---
### `width`
The width of the QuickLook view
| Type | Required | Default |
| -------- | -------- | -------- |
| Integer | No | Dimensions.get('window').width |
---
### `height`
The height of the QuickLook view
| Type | Required | Default |
| -------- | -------- | -------- |
| Integer | No | Dimensions.get('window').height |
---