strothj / react-docgen-typescript-loader

Webpack loader to generate docgen information from Typescript React components.
Other
360 stars 47 forks source link

question about customization of page layout? #94

Open dgreene1 opened 4 years ago

dgreene1 commented 4 years ago

It would be great to be able to layout the docs page for components differently.

For instance, if we could show all of the stories for a given component on the same page that would be ideal.

I did see something akin to this in the storybook PRs, but I'm not sure that we have access to it when using this loader. Or perhaps the subcomponents parameter might be another way of achieving this?

dgreene1 commented 4 years ago

Update: I still can't find how to configure this for react-docgen-typescript-loader; however, for CSF it's pretty easy to do:

import {
    Title,
    Subtitle,
    Description,
    Primary,
    Props,
    Stories,
  } from '@storybook/addon-docs/blocks';

const kind: KindMeta<typeof VtxButton> = {
    title: 'Components/Button',
    component: VtxButton,
    parameters: {
        info: { inline: true },
        docs: {
            page: () => {
                const pageComponents = (
                    <>
                        <Title />
                        <Subtitle />
                        <Description />
                        <Primary />
                        <Stories />
                        <Props />
                    </>
                );

                return pageComponents;
            },
        },
    },
};

However, there seems to be a few issues related to CSF not being able to find the source and or props. So that's why I'm leaning towards the component version that we have here.

But it would be great if we had some control over the page here.