Astro footnotes work with no setup: write [^1] in the text and [^1]: The note. anywhere below, and Astro renders a superscript link plus a numbered Footnotes section at the end of the page with back-links. Footnotes are part of GitHub-Flavored Markdown, which Astro enables by default in both .md and .mdx files.
Key Takeaways
- Footnotes come from GFM, on by default in Astro 7’s Sätteri processor and in
unified().- The output is an accessible
sectionwith a visually hidden “Footnotes” heading and back-reference links.- Rename the heading with
gfm: { footnotes: { label } }in Sätteri, orremarkRehype.footnoteLabelinunified().- Style the section with
.footnotesand[data-footnote-ref]selectors.
Write a footnote
<!-- src/content/blog/static-hosting.md -->
Static hosting is free on most providers[^cost], and the output is plain HTML[^html].
[^cost]: Within each provider's free tier limits for bandwidth and builds.
[^html]: Plus CSS, assets and any JavaScript your islands need.
Labels can be numbers or words; the output is numbered in order of first reference. Definitions can sit anywhere in the file, so many writers keep them right under the paragraph that uses them.
What Astro outputs
<p>Static hosting is free on most providers<sup><a href="#user-content-fn-cost" id="user-content-fnref-cost" data-footnote-ref aria-describedby="footnote-label">1</a></sup>...</p>
<section data-footnotes class="footnotes">
<h2 class="sr-only" id="footnote-label">Footnotes</h2>
<ol>
<li id="user-content-fn-cost">
<p>Within each provider's free tier... <a href="#user-content-fnref-cost" data-footnote-backref aria-label="Back to reference 1">↩</a></p>
</li>
</ol>
</section>
The heading has class sr-only, so screen readers announce it but sighted readers do not see it unless you add that utility class to your CSS. Tailwind includes sr-only; without Tailwind, define it yourself or show the heading.
Rename the Footnotes heading
With Astro 7’s default Sätteri processor, install @astrojs/markdown-satteri to configure it, then:
// astro.config.mjs
import { defineConfig } from 'astro/config';
import { satteri } from '@astrojs/markdown-satteri';
export default defineConfig({
markdown: {
processor: satteri({ features: { gfm: { footnotes: { label: 'Notes' } } } }),
},
});
If you use the remark pipeline instead (npm install @astrojs/markdown-remark), pass remark-rehype options:
// astro.config.mjs
import { defineConfig } from 'astro/config';
import { unified } from '@astrojs/markdown-remark';
export default defineConfig({
markdown: {
processor: unified({
remarkRehype: { footnoteLabel: 'Notes', footnoteBackLabel: 'Back to text' },
}),
},
});
MDX files inherit the configured processor’s settings, so one change covers both. Our Markdown pipeline guide explains how the two processors differ.
Style the section
/* src/styles/global.css */
.footnotes {
margin-top: 3rem;
padding-top: 1rem;
border-top: 1px solid #e2e8f0;
font-size: 0.9em;
}
.footnotes h2.sr-only {
position: static;
width: auto;
height: auto;
clip: auto;
font-size: 1rem;
}
[data-footnote-ref] {
text-decoration: none;
padding-inline: 0.1em;
}
[data-footnote-ref]::before { content: '['; }
[data-footnote-ref]::after { content: ']'; }
The second rule makes the hidden heading visible. Remove it if you prefer the screen-reader-only label. With Tailwind Typography, footnotes are styled by prose; see our Tailwind Typography tip. The Astro Markdown guide covers the built-in features, and our blog and editorial themes already style footnotes, as noted in the content docs.
FAQ
Does Astro support footnotes in Markdown?
Yes. Footnotes are part of GitHub-Flavored Markdown, which Astro enables by default for .md and .mdx files. Use [^label] in text and [^label]: note for the definition.
How do I change the footnotes heading in Astro?
With the default Sätteri processor, set gfm: { footnotes: { label: 'Notes' } } in satteri({ features }). With unified(), set remarkRehype: { footnoteLabel: 'Notes' }.
Why is my footnotes heading invisible?
Astro renders it with class sr-only, meant for screen readers only. Add CSS that undoes the hiding for .footnotes h2, or leave it hidden on purpose.