Displays PDF, Images in native iOS Quicklook
npm install expo-quicklook-previewA native module for Expo that enables document preview using iOS’s QLPreviewController.
- Preview PDF, DOCX, images, and more
- Native iOS QuickLook UI
- Supports local and remote URLs
- Full zoom and scroll gestures
> This module is built using Expo Module API. It requires that you build a custom development build of your Expo app as it does not include your native module.
``bashaddTip: In npm v7+,
works just like install.`Simply replace
Build your app for development:
`bash`
npx expo run:ios
`typescript jsx
import { preview } from "expo-quicklook-preview";
const previewImage = async () => {
const fileURL = "https://pierrejanineh.com/galleryImages/Food-IMG_1515-4-1920w.jpg";
try {
await preview({
url: fileURL,
fileName: 'Faux Wine.jpg' // Optionally, pass a file name with an extension
});
// Handle user state, analytics, etc...
} catch (e) {
// Handle errors as needed (possible errors listed below).
}
}
``
| Cases | Formatted message |
|-------------|----------------------------------------------------------------------------------|
| Invalid URL | Invalid URL provided. Please ensure the URL is properly formatted and accessible. |
| Not A File | The provided URL does not point to a valid file. |
| Pierre Janineh
– | Ophir Bucai
– |
|--------------------------------------------------------------|-----------------------------------------------------|
Expo QuickLook Preview is MIT licensed.