@stesura/references-react
React UI for footnotes, endnotes and cross-references. Most hosts only need
referenceUiExtensions; the individual pieces are exported for hosts that
build their own toolbar or layout.
See the references guide for how the feature behaves.
referenceUiExtensions
The whole feature as one UI extension: toolbar groups (References and View tabs), the cross-reference panel, context menu and preview, the anchor node views, and both note panels in the document overlay.
import { referenceUiExtensions } from '@stesura/references-react'
<StesuraEditor uiExtensions={[referenceUiExtensions]} />Toolbar groups
For hand-built toolbars. Each renders a ready-made group of buttons; the buttons themselves stay internal.
| Export | Contents |
|---|---|
FootnotesGroup | Insert footnote, previous/next, open the panel |
EndnotesGroup | Insert endnote, previous/next, open the panel |
CrossReferenceGroup | Open the cross-reference panel |
OpenFootnotesGroup | Open the footnote panel (View tab) |
OpenEndnotesGroup | Open the endnote panel (View tab) |
Note panels
FootnotePanel and EndnotePanel take no props. Each renders the panel for its kind, plus the
listener that opens it on a search match inside a note. Render them inside the editor (they read
its context); they position themselves at the bottom of the nearest positioned ancestor.
referenceNodeViews
The footnote and endnote anchor node views, keyed by node name. Without them anchors fall back to
the schema’s toDOM: they show their number but don’t open the panel.
Not exported separately
The cross-reference panel, its context-menu entries and the Ctrl/⌘ preview are only available
through referenceUiExtensions.