npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

revealjs-citations

v0.1.5

Published

Citations for reveal.js with react slides with automatic per-slide source collection.

Readme

revealjs-citations

A small React package for @revealjs/react that formats citations with citation-js and automatically collects them per slide.

Features

  • <Cite id="..." /> for footnote markers by default
  • markerStyle="brackets" | "superscript" on <CitationProvider />
  • <Cite id={["...", "..."]} /> for grouped markers like [1, 2]
  • <Cite id="..." inline="narrative" /> and <Cite id="..." inline="parenthetical" />
  • <Sources /> shows only the footnote sources for the current slide
  • Footnote sources in short form, like inline citations but without parentheses
  • <Bibliography /> generates a global bibliography from all sources used in the deck
  • automatic slide assignment via the next surrounding section
  • only one public wrapper: <CitationProvider />

Installation

npm install revealjs-citations

Expected data format

The package expects an array of CSL-JSON-like entries with a stable id.

[
  {
    "id": "vaswani2017",
    "type": "paper-conference",
    "title": "Attention Is All You Need",
    "author": [{ "family": "Vaswani", "given": "Ashish" }],
    "issued": { "date-parts": [[2017]] }
  }
]

Basic usage

import { Deck, Slide } from "@revealjs/react";
import {
  Bibliography,
  Cite,
  CitationProvider,
  Sources,
} from "reveajs-citations";

import references from "./references.json";

export default function Presentation() {
  return (
    <CitationProvider
  entries={references}
  style="apa"
  locale="de-DE"
  markerStyle="brackets"
  defaultInlineMode="parenthetical"
>
      <Deck>
        <Slide>
          <h2>Transformer</h2>
          <p>
            The architecture became well known through <Cite id="vaswani2017" /> -> [1]
            .
          </p>
          <p>
            You can also use <Cite id="vaswani2017" inline="parenthetical" /> -> (Vaswani et al. 2017)
            inline in the text.
          </p>
          <p>
            Or narrative citations: <Cite id="vaswani2017" inline="narrative" /> -> Vaswani et al.
            (2017).
          </p>
          <small>
            <Sources />
          </small>
        </Slide>

        <Slide>
          <h2>References</h2>
          <Bibliography />
        </Slide>
      </Deck>
    </CitationProvider>
  );
}

API

CitationProvider

<CitationProvider
  entries={references}
  style="apa"
  locale="de-DE"
  markerStyle="brackets"
  defaultInlineMode="parenthetical"
>
  {children}
</CitationProvider>

Props:

  • entries: array of citations with id
  • style: CSL style, default apa
  • locale: language/locale, default de-DE
  • markerStyle: "brackets" | "superscript", default "brackets"
  • defaultInlineMode: fallback for inline={true}, default "parenthetical"

Cite

<Cite id="vaswani2017" />
<Cite id={["vaswani2017", "devlin2019"]} />
<Cite id="vaswani2017" inline="narrative" />
<Cite id="vaswani2017" inline="parenthetical" />

Props:

  • id: string | string[]
  • inline?: boolean | "narrative" | "parenthetical"
  • prefix?: string
  • suffix?: string
  • className?: string

Behavior:

  • Default is footnote mode and renders a global marker like [1], [2], ... according to the first use in the entire deck
  • Multiple IDs are rendered as grouped markers like [1, 2]
  • inline="narrative" renders Vaswani et al. (2017)
  • inline="parenthetical" renders (Vaswani et al. 2017)
  • inline={true} uses the provider default from defaultInlineMode

Sources

<Sources />

Shows only the footnote sources for the current slide, side by side instead of as a list. The markers remain global and do not reset per slide. The entries are rendered in short form, like inline citations without parentheses.

Props:

  • separator?: React.ReactNode – default ·
  • showMarkers?: boolean – default true
  • className?: string
  • as?: React.ElementType

Bibliography

<Bibliography />

Displays a global bibliography from all sources cited in the deck.

Props:

  • ids?: string[] – optionally define manually
  • className?: string
  • as?: React.ElementType

Internal architecture

The store saves all used sources grouped by slide ID.

{
  bySlide: {
    'section:intro': {
      usedIds: ['vaswani2017', 'devlin2019'],
      footnoteIds: ['vaswani2017']
    }
  }
}

The slide ID is automatically determined via the next surrounding section.

Notes

  • For the default footnote mode, Sources should be rendered on the same slide.
  • If a Reveal slide already has an HTML id, that will be preferred.