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

How to use addon-notes in combination with CSF stories? #8746

Closed
daviddelusenet opened this issue Nov 7, 2019 · 4 comments
Closed

How to use addon-notes in combination with CSF stories? #8746

daviddelusenet opened this issue Nov 7, 2019 · 4 comments

Comments

@daviddelusenet
Copy link

I'm using both the most recent version of storybook and the addon-notes addon.

However, I can't get the notes the work with my stories written in the CSF format.

Example of one of my stories:

import ErrorMessage from './ErrorMessage';
import React from 'react';
import { text } from '@storybook/addon-knobs';

export default { title: 'atoms/ErrorMessage' };

export const Configurable = () => (
    <ErrorMessage>
        {text('Error message', 'Everything is broken, help!')}
    </ErrorMessage>
);

So how would I add notes to this story?

@daviddelusenet
Copy link
Author

daviddelusenet commented Nov 7, 2019

I figured it out. You should set the notes key inside of the parameters object:

import ErrorMessage from './ErrorMessage';
import React from 'react';
import test from './test.md';
import { text } from '@storybook/addon-knobs';

export default {
    parameters: {
        notes: test,
    },
    title: 'atoms/ErrorMessage',
};

export const Configurable = () => (
    <ErrorMessage>
        {text('Error message', 'Everything is broken, help!')}
    </ErrorMessage>
);

@patrick-radulian
Copy link

Have you found out whether there's any way to supply a separate note per story?
Using the parameters field sets the notes for all stories of that component, which is pretty limiting.
Any ideas?

@daviddelusenet
Copy link
Author

@patrick-radulian nope, we're just using the solution mentioned above, sorry 😞

@patrick-radulian
Copy link

Thanks for the quick reply - will keep digging and notify if I find something useful.

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

No branches or pull requests

3 participants