Skip to main content

Research papers

Paper

Citations, references, figures and cross-references extracted from the PDF.


Paper.Root analyses the document and creates the PaperState. Paper.Layer turns in-text citations and “Fig. 3”-style references into links; the cards and lists read the model.

Anatomy

<Paper.Root provider={defaultCitationProvider()}>
	<!-- inside each Viewer.Page -->
	<Paper.Layer />
	<Paper.Headings />
	<!-- anywhere inside -->
	<Paper.CitationCard />
	<Paper.CrossRefPreview />
	<Paper.References />
	<Paper.Figures />
</Paper.Root>
<Paper.Root provider={defaultCitationProvider()}>
	<!-- inside each Viewer.Page -->
	<Paper.Layer />
	<Paper.Headings />
	<!-- anywhere inside -->
	<Paper.CitationCard />
	<Paper.CrossRefPreview />
	<Paper.References />
	<Paper.Figures />
</Paper.Root>

Usage

  • Click hooks (onCitationClick, onCrossRefClick, onReferenceClick) let your app open or import cited papers instead of jumping.
  • Paper.CitationCard layout="list" shows every reference of a group like [1, 2, 3].
  • Paper.Headings adds hidden real headings for screen readers and DOM-based tables of contents.

Guide: Research papers.

API reference

Paper.Root

A provider: renders no element of its own.

Prop Type Default
provider Reference metadata provider (e.g. `defaultCitationProvider()`); optional. CitationProvider | null —
auto Analyze automatically on load. Default true. boolean —
onAnalyzed (model: PaperModel) => void —
cache Keep analyses across sessions, by document fingerprint (e.g. `indexedDbStore('my-app', 'papers')`): a paper opened again isn't analyzed again. KeyValueStore<PaperModel> | null —
isolate Analyze on a second pdf.js worker, off the rendering one (not for very large files). Default true. boolean —
paper bindable PaperState —

Paper.Layer

Renders a <div> (or your element via child) and accepts its HTML attributes.

Prop Type Default
citations boolean true
crossRefs boolean true
backlinks Hover targets on labels mentioned elsewhere ("Figure 3", "(2)", headings) for `Paper.Backlinks`. Default true. boolean true
onCitationClick Replace the click action on an in-text citation. Return false to skip the default jump. ( citation: InTextCitation, references: Reference[], event: MouseEvent ) => void | false —
onCrossRefClick Replace the click action on "Fig. 3" / "Section 2" links. Return false to skip the default jump. (crossRef: CrossRef, event: MouseEvent) => void | false —
Data attributes data-hovereddata-kinddata-pdf-backlink-targetdata-pdf-citationdata-pdf-crossrefdata-pdf-paper-layer

Paper.CitationCard

Renders a <div> (or your element via child) and accepts its HTML attributes.

Prop Type Default
forceMount Keep rendering the `child` snippet while closed (with `open: false`) so you can run exit transitions. boolean false
onOpenChange (open: boolean) => void —
placement 'top' | 'bottom' | 'left' | 'right' 'top'
delay number 200
layout Groups like [1,2,3]: 'list' shows all, 'pager' one at a time, 'auto' lists up to 4. Default 'auto'. 'auto' | 'list' | 'pager' 'auto'
onReferenceClick Replace the default "go to reference" (e.g. open or import the cited paper). Return false to skip the default. ( reference: Reference, citation: InTextCitation, event?: Event ) => void | false —
reference Custom rendering of each reference (default card parts otherwise). Snippet< [ { reference: Reference; metadata: MetadataState | undefined; go: (e?: Event) => void; compact: boolean; } ] > —
actions Extra actions in each reference's footer (Save, Import, Open…). Snippet<[{ reference: Reference; metadata: MetadataState | undefined }]> —
Snippet prop Type
open boolean
citation InTextCitation
references Reference[]
index Index of the reference shown in 'pager' layout. number
reference Reference
metadata MetadataState | undefined
layout 'pager' | 'list'
next () => void
prev () => void
go (reference?: Reference) => void
Data attributes data-compactdata-force-mountdata-layoutdata-partdata-pdf-citation-carddata-state

Paper.CrossRefPreview

Renders a <div> (or your element via child) and accepts its HTML attributes.

Prop Type Default
forceMount Keep rendering the `child` snippet while closed (with `open: false`) so you can run exit transitions. boolean false
onOpenChange (open: boolean) => void —
placement 'top' | 'bottom' | 'left' | 'right' 'top'
width number 440
delay number 250
Snippet prop Type
label string
open boolean
canvasProps Record<string | symbol, unknown>
Data attributes data-force-mountdata-kinddata-partdata-pdf-crossref-previewdata-state

Renders a <div> (or your element via child) and accepts its HTML attributes.

Prop Type Default
forceMount Keep rendering the `child` snippet while closed (with `open: false`) so you can run exit transitions. boolean false
onOpenChange (open: boolean) => void —
placement 'top' | 'bottom' | 'left' | 'right' 'top'
delay number 300
width number 380
Snippet prop Type
open boolean
label What is mentioned ("Figure 3", "Equation 2", a section title). string
mentions BacklinkMention[]
Data attributes data-force-mountdata-partdata-pdf-backlinksdata-state

Paper.References

Renders a <div> (or your element via child) and accepts its HTML attributes.

Prop Type Default
item Snippet<[ReferenceItemSnippetProps]> —
Snippet prop Type
references Reference[]
Data attributes data-citeddata-partdata-pdf-referencedata-pdf-references

Paper.Figures

Renders a <div> (or your element via child) and accepts its HTML attributes.

Prop Type Default
kinds Figure['kind'][] —
thumbnails boolean true
thumbnailWidth number 220
item Snippet<[{ figure: Figure; go: () => void }]> —
Snippet prop Type
figures Figure[]
Data attributes data-kinddata-partdata-pdf-figuredata-pdf-figures

Paper.Headings

Renders a <div> (or your element via child) and accepts its HTML attributes.

Prop Type Default
idPrefix Prefix for heading ids (id = prefix + section id). Default 'section-'. string 'section-'
baseLevel Heading level used for top-level sections. Default 2. number 2
visible Show the headings (debug); hidden from view but not from assistive tech by default. boolean false
Data attributes data-leveldata-pdf-headingdata-pdf-headingsdata-sectiondata-visible