Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add description field from __docgenInfo for prop table for info plugin #929

Merged
merged 1 commit into from
Apr 28, 2017

Conversation

konsumer
Copy link
Contributor

@konsumer konsumer commented Apr 21, 2017

Issue:

I'd like to see description from __docgenInfo in the props documentation in info plugin

What I did

Added code to PropTable

How to test

Make a story with a component that has documented (via docgen-style text) props, and the description will show up.

Like this:

/** cool button-type thing */
const Button = ({children, onClick}) => (
  <button onClick={onClick}>{children}</button>
)
Button.propTypes = {
  /** Things and stuffs */
  onClick: PropTypes.func
}

storiesOf('Button', module)
  .addWithInfo('demo - David', 'Button with children set to "David"', () => (
    <Button onClick={action('clicked')}>David</Button>
  ))

You will see a description field in the table that says Things and stuffs.

@ndelangen ndelangen merged commit 25d8a2e into storybookjs:master Apr 28, 2017
@ndelangen
Copy link
Member

Thank you @konsumer !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants