Skip to main content

Getting Started

Prerequisites

  • Expo SDK 52 or later
  • Managed or bare workflow
  • iOS 13+ / Android 5.0+

Installation

npx expo install @magrinj/expo-quick-look

No additional native configuration is required. The Expo config plugin handles everything automatically.

Quick Example

Preview a local file:

import ExpoQuickLook from '@magrinj/expo-quick-look';

// Preview a file
await ExpoQuickLook.previewFile({
uri: '/path/to/file.pdf',
});

Preview a remote file (the library downloads it automatically):

await ExpoQuickLook.previewFile({
uri: 'https://example.com/document.pdf',
});

Check if a file can be previewed:

const supported = await ExpoQuickLook.canPreview('/path/to/file.pdf');

How It Works

  • iOS: Presents a QLPreviewController modally. The promise resolves when the user dismisses the preview. Supports 100+ file formats natively, including PDF, images, Office documents, and more.
  • Android: Launches an Intent chooser with ACTION_VIEW. The promise resolves immediately after launch. The system picks the best available app for the file type.

Next Steps

Example App

See the example app for a complete demo with all features.