
Description
react-document-meta sets HTML meta tags for React apps, including the tags used for search engines, Open Graph and Twitter cards. It works for both client-side rendering and server-side rendering, and its API is strict but flexible. Meta data is declared with a DocumentMeta component, and the deepest data set wins. To keep defaults and change only some tags, you add an extend attribute so a nested component merges with the values from one level up. The library can generate Open Graph title, description and URL automatically from your title, description and canonical values, unless you set the Open Graph values explicitly. The package is built on React Side Effect. Installation is from npm, and React 0.14 or later is needed. The README covers the 0.13 workaround, which is to use react-document-meta 1.0.0, and the upgrade path from 0.1.x. An example folder shows a working sample.…
Highlights
- Declarative meta tags for React
- Nested defaults with extend
- Automatic Open Graph tags
- Client-side and server-side rendering
- Built on React Side Effect
Ratings & Reviews
No ratings yet
Be the first to rate react-document-meta.
People also visit
react-document-meta FAQ
What is react-document-meta?
A React library for setting HTML meta tags, such as title, description and Open Graph tags, from your components.
Which React version does it need?
React 0.14 or later. The README says React 0.13 needs react-document-meta 1.0.0.
How do nested meta tags work?
The deepest data set is used. Add an extend attribute to a DocumentMeta component to merge its tags with the ones set one level up.
Does it work with server-side rendering?
Yes. The README has a server usage section for projects that render on the server.
Does it generate social tags?
Yes. It creates Open Graph title, description and URL from your title, description and canonical values, unless you set those tags explicitly.
What are the best react-document-meta alternatives?
Popular alternatives to react-document-meta include react-document-title, react-meta-tags and react-titled. See all react-document-meta alternatives


















