csf icon indicating copy to clipboard operation
csf copied to clipboard

Dynamic stories

Open kirkstrobeck opened this issue 3 years ago • 3 comments

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.

kirkstrobeck avatar Aug 15 '21 19:08 kirkstrobeck

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

rpander93 avatar Nov 22 '22 17:11 rpander93

@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.

kasperpeulen avatar Nov 22 '22 19:11 kasperpeulen

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

rpander93 avatar Nov 23 '22 09:11 rpander93