Storybook is a frontend workshop for building UI components and pages in isolation. Storybook runs alongside your app in development mode. It helps you build UI components isolated from the business logic and context of your app.
This application is built using the React framework and is intended to help you understand and navigate the Storybook workshop.
Task is the core component of our app. Each task displays slightly differently depending on exactly what state it’s in. We display a checked (or unchecked) checkbox, some information about the task, and a “pin” button, allowing us to move tasks up and down the list. Putting this together, we’ll need these props:
title – a string describing the task state - which list is the task currently in, and is it checked off?
-
Create the application.
Use degit to get this template.
# Clone the template npx degit chromaui/intro-storybook-react-template taskbox
-
Install the dependencies.
Navigate into your new site’s directory and install the necessary dependencies.
# Navigate to the directory cd taskbox/ # Install the dependencies yarn
-
Browse your stories!
Run
yarn storybook
to see your component's stories athttp://localhost:6006
A quick look at the top-level files and directories included with this template.
.
├── .storybook
├── node_modules
├── public
├── src
├── .gitignore
├── .index.html
├── LICENSE
├── package.json
├── yarn.lock
├── vite.config.js
└── README.md
-
.storybook
: This directory contains Storybook's configuration files. -
node_modules
: This directory contains all of the modules of code that your project depends on (npm packages). -
public
: This directory will contain the development and production build of the site. -
src
: This directory will contain all of the code related to what you will see on your application. -
.gitignore
: This file tells git which files it should not track or maintain during the development process of your project. -
.index.html
: This is the HTML page that is served when generating a development or production build. -
LICENSE
: The template is licensed under the MIT licence. -
package.json
: Standard manifest file for Node.js projects, which typically includes project specific metadata (such as the project's name, the author among other information). It's based on this file that npm will know which packages are necessary to the project. -
yarn.lock
: This is an automatically generated file based on the exact versions of your npm dependencies that were installed for your project. (Do not change it manually). -
vite.config.js
: This is the configuration file for Vite, a build tool that aims to provide a faster and leaner development experience for modern web projects. -
README.md
: A text file containing useful reference information about the project.