Skip to content
PluginStats

babel-plugin-react-docgen weekly downloads statistics

By storybooks · npm · Babel plugins

Babel plugin to add react-docgen info into your code

View on npm Fresh · Dec 6, 2026

babel-plugin-react-docgen has 734,187 recorded weekly downloads on npm, an increase of 5.1% over the past 30 days, ranking #329 of 3,247 tracked listings.

Weekly downloads
734,187
Official API · Dec 5, 2026
7-day growth
-2.5%
-19.2K weekly downloads
30-day growth
+5.1%
+35.5K weekly downloads
90-day growth
+26.9%
+155.8K weekly downloads
Rank
#329
▼ 17 in 7 days

About babel-plugin-react-docgen

babel-plugin-react-docgen

react-docgen allows you to write propType descriptions, class descriptions and access propType metadata programatically.

This babel plugin allow you to access those information right inside your React class.

For an example, let's say you've a React class like this:

/**
  This is an awesome looking button for React.
*/
import React from 'react';

export default class Button extends React.Component {
  render() {
    const { label, onClick } = this.props;
    return (
      <button onClick={onClick}>{ label }</button>
    );
  }
}

Button.propTypes = {
  /**
    Label for the button.
  */
  label: React.PropTypes.string,

  /**
    Triggered when clicked on the button.
  */
  onClick: React.PropTypes.func,
};

With this babel plugin, you can access all these information right inside your app with:

console.log(Button.__docgenInfo);
<details> <summary>Click to see the output</summary>
{
  description: 'This is an awesome looking button for React.',
  props: {
    label: {
      type: {
        name: 'string'
      },
      required: false,
      description: 'Label for the button.'
    },
    onClick: {
      type: {
        name: 'func'
      },
      required: false,
      description: 'Triggered when clicked on the button.'
    }
  }
}
</details>

This will be pretty useful for documentations and some other React devtools like Storybook.

Usage

Install the plugin:

npm install -D babel-plugin-react-docgen

Use it inside your .babelrc

{
  "plugins": ["react-docgen"]
}

.babelrc Options

optiondescriptiondefault
resolverYou may use the 3 built-in react-docgen resolvers by specifying its name as a string, or you may specify a custom resolver by specifying the function explicitly."findAllExportedComponentDefinition"
handlersAll react-docgen handlers are automatically applied. However, custom handlers can be added by specifying them here. Any string value will be loaded by require, and a function will be used directly.
removeMethodsUsed to remove docgen information about methods.false
DOC_GEN_COLLECTION_NAMEThe name of a global variable where all docgen information can be stored. See below for more information.
...optionsRemaining options will be passed directly as react-docgen options. Any options they allowed will be passed through, but the filename will be overwritten by the filename provided by babel.

Collect All Docgen Info

Sometimes, it's a pretty good idea to collect all of the docgen info into a collection. Then you could use that to render style guide or similar.

So, we allow you to collect all the docgen info into a global collection. To do that, add following config to when loading this babel plugin:

{
  "plugins":[
    [
      "babel-plugin-react-docgen",
      {
        "DOC_GEN_COLLECTION_NAME": "MY_REACT_DOCS",
        "resolver": "findAllComponentDefinitions", // optional (default: findAllExportedComponentDefinitions)
        "removeMethods": true, // optional (default: false)
        "handlers": ["react-docgen-deprecation-handler"] // optional array of custom handlers
      }
    ]
  ]
}

Then you need to create a global variable(an object) in your app called MY_REACT_DOCS before any code get's executed. Then we'll save them into that object. We do it by adding a code block like this to the transpiled file:

if (typeof MY_REACT_DOCS !== 'undefined') {
  MY_REACT_DOCS['test/fixtures/case4/actual.js'] = {
    name: 'Button',
    docgenInfo: Button.__docgenInfo,
    path: 'path/to/my/button.js'
  };
}

Compile Performance

We parse your code with react-docgen to get this info, but we only do it for files which contain a React component.

There will be some overhead to your project, but you can leverage babel's cache directory to avoid this a huge performance hit.

Output Size

Yes this increase the output size of your transpiled files. The size increase varies depending on various factors like:

  • How many react classes you've
  • Amount of docs you've written
  • Amount of propTypes you've

Most of the time, you need this plugin when you are developing your app or with another tool like Storybook. So, you may not need to use this on the production version of your app.

Description from the npm listing.

  • react
  • docs
  • docgen
  • babel-plugin

README badge

Show your rank in a README or on your website. The badge updates automatically.

Charts

Images: 30d · 1y · all time · 1600×900 dark

Adoption over time

babel-plugin-react-docgen weekly downloads on npm, last 90 days: 734,187 weekly downloads as of Dec 5, 2026, +26.9% over 90 days.babel-plugin-react-docgenWeekly downloads on npm · Last 90 days734,187downloads / week+26.9% over 90 days0200K400K600K800K1MSep 6Sep 21Oct 6Oct 21Nov 5Nov 20Dec 5downloads / weekobservedarchived (Internet Archive)no observationsSep 7, 2026 – Dec 5, 2026 · 90 observations · Updated Dec …pluginstats.com
babel-plugin-react-docgen weekly downloads on npm, last 90 days: 734,187 weekly downloads as of Dec 5, 2026, +26.9% over 90 days.

7/30/90-day growth

babel-plugin-react-docgen weekly downloads growth on npm: -2.5% over 7 days, +5.1% over 30 days, +26.9% over 90 days.babel-plugin-react-docgenWeekly downloads growth on npm734,187downloads / week now7-day growth-19,158 weekly downloads-2.5%30-day growth+35,475 weekly downloads+5.1%90-day growth+155,799 weekly downloads+26.9%Growth vs. nearest observation to each baseline date · Updated Dec 5, 2026pluginstats.com
babel-plugin-react-docgen weekly downloads growth on npm: -2.5% over 7 days, +5.1% over 30 days, +26.9% over 90 days.

Ranking history

babel-plugin-react-docgen npm ranking history: currently #329 (by weekly downloads).babel-plugin-react-docgennpm ranking · by weekly downloads · Last 90 days#329current rank#280#290#300#310#320#330#340Sep 7Sep 22Oct 7Oct 22Nov 6Nov 21Dec 6rankOct 18, 2026 – Dec 6, 2026 · 44 observations · Updated Dec 5, 2026pluginstats.com
babel-plugin-react-docgen npm ranking history: currently #329 (by weekly downloads).

Listing placement

All npm3,247 listings · 163 pages · 1,084 shown · page 17, #9 (overall #329)
All npm: every listing in weekly downloads order

Listing placement

Babel plugins263 listings · 14 pages · page 8, #18 (overall #158)
Babel plugins: every listing in weekly downloads order

Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.

Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.

Recent observations

Full history (170)
Recent weekly downloads observations for babel-plugin-react-docgen
Date (UTC)Weekly downloadsChange vs. previous
734,187-5.6K
739,748-2.4K
742,158+1.6K
740,550-14.7K
755,262+5.9K
749,337-14.3K
763,665+10.3K
753,345+7.7K
745,660+650
745,010-8K
753,058+2.9K
750,121+2.4K
747,724+27.9K
719,868—

Similar npm Babel plugins plugins

All 20 babel-plugin-react-docgen alternatives

Data source

Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.

Listing: https://www.npmjs.com/package/babel-plugin-react-docgen. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.