Storybook

less than 1 minute read

Storybook with React Project

Install Node

  • install node with homebrew
  • link: https://brew.sh/index_ko
    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    
    brew --version
    
    brew install node
    

Install create-react-app

npm install -g create-react-app
create-react-app --version

Create React Project

npx create-react-app <app name>
  • Create React Project with Typescript
    npx create-react-app <app name> --template=typescript
    
    cd <app name>
    npm start
    

Install Storybook

  • link: https://storybook.js.org/docs/react/get-started/install
  • you need a project ready before installation
    npx sb init
    
  • make a file of a component with ‘.stories.tsx’ in ‘stories’ directory to see on the storybook screenshot

  • basic composition of a file </br> screenshot2

Run Storybook

npm run storybook

screenshot3

Updated:

Leave a comment