New May 5, 2026

Accessible Footnotes & a Bit of React

More Front-end Bloggers All from Kitty Giraudel View Accessible Footnotes & a Bit of React on kittygiraudel.com

Footnotes are not as straightforward as they seem to be. One might thing it’s just a matter of slapping an asterisk or a number after a word, and dumping some extra sweet knowledge at the bottom of the page, but that’s not it. Assistive technologies require some careful mapping in order to correctly associate the reference with its footnote.

A few years back, I wrote Accessible footnotes with CSS, now the first result when asking Google for “accessible footnotes”. To this day, I still think it’s one of the most useful articles I’ve ever written because: a) most footnotes out there are not accessible and b) the CSS in that demo is actually pretty clever and was fun to write.

Today, I would like to revisit that implementation for using it in React. If you are interested in a ready-to-go solution, I am currently working on react-a11y-footnotes, an experimental library that you can install directly from npm to use in your projects.

What’s so hard about it?

First of all, let’s sort out nomenclature so we are all on the same page:

Here is how a footnote reference should be marked:

<p>
	Something about
	<a
		href="#css-counters-note"
		id="css-counters-ref"
		aria-describedby="footnotes-label"
		role="doc-noteref"
		>CSS counters</a
	>
	that deserves a footnote explaining what they are.
</p>

Let’s break it down:

And here is out the footnotes section would be authored:

<footer role="doc-endnotes">
	<h2 id="footnotes-label">Footnotes</h2>
	<ol>
		<li id="css-counters-note">
			CSS counters are, in essence, variables maintained by CSS whose values may
			be incremented by CSS rules to track how many times they’re used.
			<a
				href="#css-counters-ref"
				aria-label="Back to reference 1"
				role="doc-backlink"
				>↩</a
			>
		</li>
	</ol>
</footer>

Again, let’s break it down:

As you can see, there is quite a lot to unpack, and you can soon realize why maintaining footnotes by hand can be tedious and error-prone.

Here comes React

My React implementation of footnotes aims at making it easier to author the references, and making it automatic to author the footnotes, including their numbering. To do that, it needs 3 different part:

Coming back at our initial example, the usage might look like this:

const BlogPage = (props) => (
	<FootnotesProvider>
		<article>
			<p>
				Something about{" "}
				<FootnoteRef description="CSS Counters are, in essence, variables maintained by CSS whose values may be incremented by CSS rules to track how many times they’re used.">
					CSS counters
				</FootnoteRef>
				that deserves a footnote explaining what they are.
			</p>
			{/* Some more content */}
			<Footnotes />
		</article>
	</FootnotesProvider>
);

What’s nice about this approach is that footnotes are essentially out of sight, out of mind. The footnote itself is authored as the description prop on the FootnoteRef component, which makes it easy to maintain. The Footnotes component does the work of laying out the footnotes in the order of appearance in the text.

Wrapping things up

I hope react-a11y-footnotes will help people implement clean and accessible footnotes for everyone. I’m currently finalizing the API and will most likely publish a first version some time this week.

I am also playing with providing optional basic styling, especially for the references themselves since they currently rely on CSS counters, to make it easy to import the library, its styles, and start footnoting.

If you have any suggestion, comment or issue, feel free to share on Twitter or in an issue on the GitHub repository!

Scroll to top