Storybook: MDX Props table doesn't display props of external library component

Created on 3 Mar 2020  路  7Comments  路  Source: storybookjs/storybook

I have a use-case where I want to document in my storybook a material-ui component and get all of it's props to be displayed in the table.

As a naive approach, here was my mdx doc file:

import { Meta, Story, Preview, Props } from "@storybook/addon-docs/blocks";
import { Button } from "@material-ui/core";

<Meta title="Button" component={Button} />

### Basic

<Preview>
  <Story name="Basic">
    <Button>
        Storybook
    </Button>
  </Story>
</Preview>

### Props

<Props of={Button} />

Unfortunately, I couldn't see any props in the table.

I'm consuming the compiled version material-ui component which includes a separated d.ts types file with all the relevant props and descriptions but I can't seem to load them properly.

docs props feature request todo

Most helpful comment

We're updating the recommended configuration to use babel-plugin-react-docgen instead of react-docgen-typescript-loader, and they are tracking this issue here: https://github.com/reactjs/react-docgen/issues/416 please upvote!

All 7 comments

We're updating the recommended configuration to use babel-plugin-react-docgen instead of react-docgen-typescript-loader, and they are tracking this issue here: https://github.com/reactjs/react-docgen/issues/416 please upvote!

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

Any update on a fix for this?

@amilaI no, and it's not on the roadmap. we've got our hands full correctly showing props for your own component library. showing props for external libraries is not a priority use case. should it be?

@shilman IMHO, it should be. Material UI exposes theme customization that can generate most of the standard design system.
In addition to that, you add composition components and custom components.
At the same time, you want to encapsulate everything in one storybook.

point taken. to some extend we're at the mercy of the underlying docgen packages we're using (react-docgen / react-docgen-typescript) but i'll see what we can do

Having same issue, hope to get a fix soon

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tirli picture tirli  路  3Comments

miljan-aleksic picture miljan-aleksic  路  3Comments

oriSomething picture oriSomething  路  3Comments

dnlsandiego picture dnlsandiego  路  3Comments

purplecones picture purplecones  路  3Comments