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
12M
Open issues
112
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
  • 12M 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
  • 112 open issues on GitHub

FAQs

Alternatives & similar libraries