Skip to content

rajatporwal/react-storybook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Getting Started with React Story Book

Available Scripts

In the project directory, you can run:

npx sb init

  • main.js is the configuration file for storybook itself

  • preview.js is the configuration file for stories we write

  • Install addon storybook source to display source code

yarn add @storybook/addon-storysource --dev

  • Update story name without changing story export name

Small.storyName = 'Small Input'

  • sorting stories

  • global decorator : wraps every stories with some component

addDecorator(story => <Center>{story()}</Center>)

  • local decorator : wraps all the compoennt of the selected story

decorators: [story => <Center>{story()}</Center>]

yarn storybook

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published