This template ships with the main React and Storybook configuration files you'll need to get up and running fast.
-
Create the application.
Use degit to get this template.
# Clone the template npx degit harryho/storybook-react-vite-ts-template new-react-project
-
Install the dependencies.
Navigate into your new site’s directory and install the necessary dependencies.
# Navigate to the directory cd new-react-project/ # Install the dependencies yarn
-
Open the source code and start editing!
Open the
components
directory in your code editor of choice and build your first component! -
Create the stories and interactions!
Open the
stories
directory in your code editor of choice and build your stories! -
Browse your stories!
Run
yarn storybook
to see your component's stories athttp://localhost:6006
-
Test your stories!
Run
yarn test-storybook
or runyarn watch-test-storybook
to see test result.
A quick look at the top-level files and directories included with this template.
.
├── .storybook
├── node_modules
├── public
├── src
|-- components
|-- stories
├── .eslintrc.cjs
├── .gitignore
├── .index.html
├── LICENSE
├── package.json
├── tsconfig.json
├── tsconfig.vite.json
├── yarn.lock
├── vite.config.ts
└── 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. -
components
: This directory will contain all of the code related to what components you want to build. -
stories
: This directory will contain all of the code related to what stories you want to test with your components. -
.eslintrc.cjs
: This file is the configuration file for ESLint, a tool for identifying and reporting on patterns found in ECMAScript/JavaScript code. -
.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. -
tsconfig.json
: This is the configuration file for TypeScript specifies the root files and the compiler options required to compile the project. -
tsconfig.vite.json
: This is the configuration file for Vite. Vite itself including its config is running on your computer inside Node, which is totally different environment (compared with browser) with different API's and constraints. -
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.ts
: 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.
If you encounter an issue with the template, we encourage you to open an issue in this template's repository.
-
Read our introductory tutorial at Learn Storybook.
-
Learn how to transform your component libraries into design systems in our Design Systems for Developers tutorial.
-
See our official documentation at Storybook.