2.2.4 • Published 5 months ago
@unriddle-ai/lector v2.2.4
lector
A composable, headless PDF viewer toolkit for React applications, powered by PDF.js
. Build feature-rich PDF viewing experiences with full control over the UI and functionality.
Installation
npm install @unriddle-ai/lector pdfjs-dist
# or with yarn
yarn add @unriddle-ai/lector pdfjs-dist
# or with pnpm
pnpm add @unriddle-ai/lector pdfjs-dist
Basic Usage
Here's a simple example of how to create a basic PDF viewer:
import { CanvasLayer, Page, Pages, Root, TextLayer } from "@unriddle-ai/lector";
import "pdfjs-dist/web/pdf_viewer.css";
export default function PDFViewer() {
return (
<Root
source="/sample.pdf"
className="w-full h-[500px] border overflow-hidden rounded-lg"
loader={<div className="p-4">Loading...</div>}
>
<Pages className="p-4">
<Page>
<CanvasLayer />
<TextLayer />
</Page>
</Pages>
</Root>
);
}
Features
- 📱 Responsive and mobile-friendly
- 🎨 Fully customizable UI components
- 🔍 Text selection and search functionality
- 📑 Page thumbnails and outline navigation
- 🌗 First-class dark mode support
- 🖱️ Pan and zoom controls
- 📝 Form filling support
- 🔗 Internal and external link handling
Contributing
We welcome contributions! Key areas we're focusing on:
- Performance optimizations
- Accessibility improvements
- Mobile/touch interactions
- Documentation and examples
Thanks
Special thanks to these open-source projects that provided inspiration:
License
MIT © Unriddle AI
2.2.1
5 months ago
2.2.0
5 months ago
2.2.3
5 months ago
2.2.2
5 months ago
2.2.4
5 months ago
1.4.2
6 months ago
1.5.0
6 months ago
2.1.1
5 months ago
2.1.0
5 months ago
2.0.0
6 months ago
1.4.1
6 months ago
1.4.0
6 months ago
1.3.0
6 months ago
1.2.0
6 months ago
1.2.2
6 months ago
1.2.1
6 months ago
1.1.1
7 months ago
1.1.0
7 months ago
1.1.2
7 months ago
1.0.1
7 months ago
1.0.0
7 months ago