RE

React Docgen

react-docgen

A library to extract information from React components for documentation generation.

Utilities
react
documentation
documentation-generation
react-docgen
Utilities
javascript
npm
frontend
open source
ui
Stars
3.8k
Weekly
17M
Open issues
104
Bundle
~15 kB

Installation

npm install react-docgen

Code example

import { useDocgen } from "react-docgen";

export function Example() {
  const value = useDocgen();
  return <p>{String(value)}</p>;
}

Pros & cons

Pros

  • Actively maintained by Felix Kling
  • 17M weekly downloads. Battle tested
  • First-class TypeScript definitions
  • MIT licensed

Considerations

  • Adds roughly ~15 kB to your bundle
  • Needs client-only rendering in SSR frameworks
  • Not supported in React Native
  • 104 open issues on GitHub

FAQs

Alternatives & similar libraries