Apple PaperKit for Expo/React Native
expo-paperkit
Apple PaperKit markup experience for Expo/React Native โ drawings, shapes, and annotations powered by PaperKit (iOS 26+, macOS 26+).
Features
- โ๏ธ Full PaperKit drawing canvas with Apple Pencil support
- ๐ถ Shape, text box, and arrow/line insertion
- ๐พ Save/restore markup data (base64 serialization)
- ๐ผ๏ธ Export canvas as PNG or JPG
- โฉ๏ธ Undo/redo support
- โ๏ธ Configurable feature sets, zoom, and canvas size
- ๐จ PKToolPicker integration (iOS) and MarkupToolbar (macOS)
- ๐๏ธ Background image support
- ๐๏ธ Read-only mode for viewing saved markup
Requirements
- iOS 26.0+ or macOS 26.0+
- Expo SDK 54+
- React Native 0.81+
Installation
npm install expo-paperkit
or
yarn add expo-paperkit
Run npx expo prebuild to generate the native project, then build with npx expo run:ios or open the .xcworkspace in Xcode.
Note: This library requires native code and will not work in Expo Go.
macOS: For macOS support, use expo-desktop to set up your project. See the apps/macos-example/ directory for a working example.
Quick Start
import { PaperMarkupView, type PaperMarkupRef } from 'expo-paperkit';
import { useRef, useState } from 'react';
export default function App() { const markupRef = useRef<PaperMarkupRef>(null); const [savedData, setSavedData] = useState<string | null>(null);
const handleSave = async () => { const data = await markupRef.current!.save(); setSavedData(data); };
const handleExport = async () => { const uri = await markupRef.current!.exportAsImage('png', 1.0); console.log('Exported to:', uri); };
return ( <PaperMarkupView ref={markupRef} style={{ flex: 1 }} initialData={savedData ?? undefined} allowFingerDrawing featureSet={{ shapes: true, textBoxes: true, arrows: true, }} onMarkupChanged={() => console.log('Markup changed')} /> ); }
Documentation
- API Reference โ Full props, events, ref methods, and types documentation
License
MIT