{"id":47682116,"url":"https://github.com/anaralabs/lector","last_synced_at":"2026-04-02T14:03:44.492Z","repository":{"id":270088368,"uuid":"900455966","full_name":"anaralabs/lector","owner":"anaralabs","description":"Simple, fast primitives for building pdf viewers. maintained by @anaralabs","archived":false,"fork":false,"pushed_at":"2026-03-26T14:54:27.000Z","size":37638,"stargazers_count":377,"open_issues_count":38,"forks_count":37,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-26T15:24:32.205Z","etag":null,"topics":["pdf","pdfjs-dist","react","virtualization"],"latest_commit_sha":null,"homepage":"https://lector-weld.vercel.app","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anaralabs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-12-08T20:15:46.000Z","updated_at":"2026-03-26T14:51:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"69398552-23bc-44c1-9421-3f28157e5152","html_url":"https://github.com/anaralabs/lector","commit_stats":null,"previous_names":["unriddle-ai/lector","anaralabs/lector"],"tags_count":52,"template":false,"template_full_name":null,"purl":"pkg:github/anaralabs/lector","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anaralabs%2Flector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anaralabs%2Flector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anaralabs%2Flector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anaralabs%2Flector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anaralabs","download_url":"https://codeload.github.com/anaralabs/lector/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anaralabs%2Flector/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31307467,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T12:59:32.332Z","status":"ssl_error","status_checked_at":"2026-04-02T12:54:48.875Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["pdf","pdfjs-dist","react","virtualization"],"created_at":"2026-04-02T14:03:41.908Z","updated_at":"2026-04-02T14:03:44.482Z","avatar_url":"https://github.com/anaralabs.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cp align=\"center\"\u003e\n    \u003ci\u003eSimple primitives to compose powerful PDF viewing experiences.\u003cbr\u003epowered by \u003ccode\u003e\u003ca href=\"https://mozilla.github.io/pdf.js/\"\u003ePDF.js\u003c/a\u003e\u003c/code\u003e and \u003ccode\u003e\u003ca href=\"https://reactjs.org/\"\u003eReact\u003c/a\u003e\u003c/code\u003e\u003c/i\u003e\n  \u003c/p\u003e\n\u003c/p\u003e\n\n# `lector`\n\nA 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.\n\n[![npm version](https://badge.fury.io/js/@anaralabs%2Flector.svg)](https://www.npmjs.com/package/@anaralabs/lector)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n## Installation\n\n```bash\nnpm install @anaralabs/lector pdfjs-dist\n\n# or with yarn\nyarn add @anaralabs/lector pdfjs-dist\n\n# or with pnpm\npnpm add @anaralabs/lector pdfjs-dist\n```\n\n## Basic Usage\n\nHere's a simple example of how to create a basic PDF viewer:\n\n```tsx\nimport { CanvasLayer, Page, Pages, Root, TextLayer } from \"@anaralabs/lector\";\nimport \"pdfjs-dist/web/pdf_viewer.css\";\n\nexport default function PDFViewer() {\n  return (\n    \u003cRoot\n      source=\"/sample.pdf\"\n      className=\"w-full h-[500px] border overflow-hidden rounded-lg\"\n      loader={\u003cdiv className=\"p-4\"\u003eLoading...\u003c/div\u003e}\n    \u003e\n      \u003cPages className=\"p-4\"\u003e\n        \u003cPage\u003e\n          \u003cCanvasLayer /\u003e\n          \u003cTextLayer /\u003e\n        \u003c/Page\u003e\n      \u003c/Pages\u003e\n    \u003c/Root\u003e\n  );\n}\n```\n\n## Local Development using PNPM and Yalc\n\nWhen you are using \"pnpm link\", you are bound to use pnpm on your consumer project when you are developing locally.\nWith yalc, we are decoupling the need for pnpm and now the package can be tested with any package managers. Any\nchanges should be automatically published to yalc on save, forcing a rebuilt and updating the consumer project.\n\nInstall yalc globally:\n\n```\npnpm i yalc -g\n```\n\nFrom lector:\n\n```bash\n# navigate to lector package folder and install dependencies\npnpm i\n# when you first start development, make sure you publish the package locally\nyalc publish\n# and run the project in development mode to start a watcher that rebuilds the project and pushes the changes locally on save\npnpm dev\n```\n\nFrom consumer project:\n(It doesn't really matter what package manager you are using)\n\n```bash\n# add local package to your package.json of the consumer project using yalc\nyalc add @anaralabs/lector\n# or if you don't want to add the yalc package in your package.json\nyalc link @anaralabs/lector\n```\n\n## Features\n\n- 📱 Responsive and mobile-friendly\n- 🎨 Fully customizable UI components\n- 🔍 Text selection and search functionality\n- 📑 Page thumbnails and outline navigation\n- 🌗 First-class dark mode support\n- 🖱️ Pan and zoom controls\n- 📝 Form filling support\n- 🔗 Internal and external link handling\n\n## Contributing\n\nWe welcome contributions! Key areas we're focusing on:\n\n1. Performance optimizations\n2. Accessibility improvements\n3. Mobile/touch interactions\n4. Documentation and examples\n\n\n\n## Thanks\n\nSpecial thanks to these open-source projects that provided inspiration:\n\n- [react-pdf-headless](https://github.com/jkgenser/react-pdf-headless)\n- [pdfreader](https://github.com/OnedocLabs/pdfreader)\n\n## License\n\nMIT © [Anara](https://anara.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanaralabs%2Flector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanaralabs%2Flector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanaralabs%2Flector/lists"}