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

Dynamic stories #26

Open
kirkstrobeck opened this issue Aug 15, 2021 · 3 comments
Open

Dynamic stories #26

kirkstrobeck opened this issue Aug 15, 2021 · 3 comments

Comments

@kirkstrobeck
Copy link

What’s the best approach for programmatically generated stories?

For example, something like this

stories.forEach(story => {
 exports[story.name] = { 
   // story values here
 }
})

I can’t seem to get a solution with module.exports, export default, export const, exports etc.

Note: This pattern is supported by storiesOf.

@rpander93
Copy link

also interested in this! if you have a component with a couple of dimensions, creating stories manually is quite tedious

@kasperpeulen
Copy link
Contributor

@rpander93 We don't really support that in CSF3. I normally use controls for this problem if my component depends on a couple of different dimensions. So that you can easily switch within the controls to any dimension you need.

@rpander93
Copy link

right, i guess that's also a way to solve it. thanks!

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

No branches or pull requests

3 participants