Correction to: Nature Energy https://doi.org/10.1038/s41560-023-01414-5, published online 3 January 2024.

In the version of this article initially published, lithium (green, “Li”) and sodium (purple, “Na”) color key labels in Fig. 3a,d,e were interchanged and are now amended in the HTML and PDF versions of the article.