Official React starter template for InkLayer — a PDF annotation SDK built on PDF.js.
This project demonstrates how to quickly integrate InkLayer into a React application.
👉 Live Demo: https://inklayer.dev
👉 React SDK: https://github.com/Laomai-codefee/inklayer-react
👉 Vue SDK: https://github.com/Laomai-codefee/inklayer-vue
npm install
or
pnpm installnpm run dev
or
pnpm dev
http://localhost:5173- PDF rendering based on PDF.js
- Annotation system (highlight, selection, etc.)
- Annotation sidebar
- Save annotation output
import { PdfAnnotator } from 'inklayer-react'
import 'inklayer-react/style'
export default function App() {
return (
<PdfAnnotator
url="https://inklayer.dev/inklayer-demo.pdf"
user={{
id: 'demo',
name: 'Demo User',
}}
layoutStyle={{
width: '100vw',
height: '100vh',
}}
defaultShowAnnotationsSidebar
onSave={(annotations) => {
console.log('Saved annotations:', annotations)
}}
/>
)
}- Load PDF via PDF.js
- Render annotation layer on top of PDF pages
- User creates highlights / comments
- SDK emits structured annotation data via onSave
onSave returns structured annotation data:
[
{
id: "annotation-id",
kind: "text-markup",
target: { ... },
payload: { ... },
meta: { ... }
}
]- Stored in database
- Re-rendered later
- Synced across systems
- Quick SDK evaluation
- Integration testing
- Reference implementation
- Project bootstrap