New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@unriddle-ai/lector

Package Overview
Dependencies
Maintainers
0
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@unriddle-ai/lector

Headless PDF viewer for React

  • 1.4.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
261
decreased by-54.61%
Maintainers
0
Weekly downloads
 
Created
Source

Simple primitives to compose powerful PDF viewing experiences.
powered by PDF.js and React

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.

npm version License: MIT

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
      fileURL='/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:

  1. Performance optimizations
  2. Accessibility improvements
  3. Mobile/touch interactions
  4. Documentation and examples

Thanks

Special thanks to these open-source projects that provided inspiration:

License

MIT © Unriddle AI

Keywords

FAQs

Package last updated on 21 Jan 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc