Skip to content

Commit e1d14bf

Browse files
Merge pull request #21973 from storybookjs/chore_docs_update_install_instructions
Chore: (Docs) Standardize install instructions in documentation
2 parents 71b2046 + 9923805 commit e1d14bf

File tree

26 files changed

+36
-36
lines changed

26 files changed

+36
-36
lines changed

code/frameworks/angular/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ So you can develop UI components in isolation without worrying about app specifi
2727

2828
```sh
2929
cd my-angular-app
30-
npx storybook init
30+
npx storybook@latest init
3131
```
3232

3333
## Setup Storybook for your Angular projects
3434

35-
Storybook supports Angular multi-project workspace. You can setup Storybook for each project in the workspace. When running `npx storybook init` you will be asked for which project Storybook should be set up. Essentially, during initialization, the `.storybook` folder will be created and the `angular.json` will be edited to add the Storybook configuration for the selected project. The configuration looks approximately like this:
35+
Storybook supports Angular multi-project workspace. You can setup Storybook for each project in the workspace. When running `npx storybook@latest init` you will be asked for which project Storybook should be set up. Essentially, during initialization, the `.storybook` folder will be created and the `angular.json` will be edited to add the Storybook configuration for the selected project. The configuration looks approximately like this:
3636

3737
```json
3838
// angular.json

code/frameworks/ember/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ So you can develop UI components in isolation without worrying about app specifi
1212

1313
```sh
1414
cd my-ember-app
15-
npx storybook init
15+
npx storybook@latest init
1616
```
1717

1818
For more information visit: [storybook.js.org](https://storybook.js.org)

code/frameworks/html-webpack5/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ So you can develop UI components in isolation without worrying about app specifi
1414

1515
```sh
1616
cd my-app
17-
npx storybook init -t html
17+
npx storybook@latest init -t html
1818
```
1919

2020
For more information visit: [storybook.js.org](https://storybook.js.org)

code/frameworks/preact-webpack5/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ So you can develop UI components in isolation without worrying about app specifi
1212

1313
```sh
1414
cd my-preact-app
15-
npx storybook init
15+
npx storybook@latest init
1616
```
1717

1818
For more information visit: [storybook.js.org](https://storybook.js.org)

code/frameworks/react-webpack5/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ So you can develop UI components in isolation without worrying about app specifi
1212

1313
```sh
1414
cd my-react-app
15-
npx storybook init
15+
npx storybook@latest init
1616
```
1717

1818
For more information visit: [storybook.js.org](https://storybook.js.org)

code/frameworks/server-webpack5/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ So you can develop UI components in isolation without worrying about app specifi
1414

1515
```sh
1616
cd my-app
17-
npx storybook init -t server
17+
npx storybook@latest init -t server
1818
```
1919

2020
To configure the server that Storybook will connect to, export a global parameter `parameters.server.url` in `.storybook/preview.js`:

code/frameworks/svelte-webpack5/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ So you can develop UI components in isolation without worrying about app specifi
1212

1313
```sh
1414
cd my-svelte-app
15-
npx storybook init
15+
npx storybook@latest init
1616
```
1717

1818
For more information visit: [storybook.js.org](https://storybook.js.org)

code/frameworks/vue-vite/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ So you can develop UI components in isolation without worrying about app specifi
1212

1313
```sh
1414
cd my-vue-app
15-
npx storybook init
15+
npx storybook@latest init
1616
```
1717

1818
For more information visit: [storybook.js.org](https://storybook.js.org)

code/frameworks/vue-webpack5/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ So you can develop UI components in isolation without worrying about app specifi
1212

1313
```sh
1414
cd my-vue-app
15-
npx storybook init
15+
npx storybook@latest init
1616
```
1717

1818
For more information visit: [storybook.js.org](https://storybook.js.org)

code/frameworks/vue3-vite/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ So you can develop UI components in isolation without worrying about app specifi
1212

1313
```sh
1414
cd my-vue3-app
15-
npx storybook init
15+
npx storybook@latest init
1616
```
1717

1818
For more information visit: [storybook.js.org](https://storybook.js.org)

code/frameworks/vue3-webpack5/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ So you can develop UI components in isolation without worrying about app specifi
1212

1313
```sh
1414
cd my-vue3-app
15-
npx storybook init
15+
npx storybook@latest init
1616
```
1717

1818
For more information visit: [storybook.js.org](https://storybook.js.org)

code/frameworks/web-components-webpack5/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ So you can develop UI components in isolation without worrying about app specifi
1414

1515
```sh
1616
cd my-app
17-
npx storybook init -t web_components
17+
npx storybook@latest init -t web_components
1818
```
1919

2020
For more information visit: [storybook.js.org](https://storybook.js.org)

docs/addons/writing-addons.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ We'll need to add the necessary dependencies and make some adjustments. Run the
6666
Initialize a local Storybook instance to allow you to test your addon.
6767

6868
```shell
69-
npx storybook init
69+
npx storybook@latest init
7070
```
7171

7272
<div class="aside">

docs/builders/overview.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ Storybook, at its core, is powered by builders such as Webpack and Vite. These b
88

99
## CLI basics
1010

11-
Before diving into setting up Storybook's builders, let's look at how the CLI configures them. When you initialize Storybook (via `npx storybook init`), the CLI automatically detects which builder to use based on your application. For example, if you're working with Vite, it will install the Vite builder. If you're working with Webpack, it installs the Webpack 5 builder by default.
11+
Before diving into setting up Storybook's builders, let's look at how the CLI configures them. When you initialize Storybook (via `npx storybook@latest init`), the CLI automatically detects which builder to use based on your application. For example, if you're working with Vite, it will install the Vite builder. If you're working with Webpack, it installs the Webpack 5 builder by default.
1212

1313
Additionally, you can also provide a flag to Storybook's CLI and specify the builder you want to use:
1414

1515
```shell
16-
npx storybook init --builder <webpack5 | vite>
16+
npx storybook@latest init --builder <webpack5 | vite>
1717
```
1818

1919
## Manual setup

docs/builders/vite.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Storybook Vite builder bundles your components and stories with [Vite](https://v
99

1010
## Setup
1111

12-
If you ran `npx storybook init` to include Storybook in your Vite application, the builder is already installed and configured for you. If you want, you can also opt into it manually.
12+
If you ran `npx storybook@latest init` to include Storybook in your Vite application, the builder is already installed and configured for you. If you want, you can also opt into it manually.
1313

1414
Run the following command to install the builder.
1515

docs/get-started/installation-problems/angular.mdx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
- Add the `--type angular` flag to the installation command to set up Storybook manually:
22

33
```shell
4-
npx storybook init --type angular
4+
npx storybook@latest init --type angular
55
```
66

77
- Storybook's CLI provides support for [Yarn](https://yarnpkg.com/), [npm](https://www.npmjs.com/), and [pnpm](https://pnpm.io/) package managers. If you have Yarn installed in your environment but prefer to use another as your default package manager add the `--package-manager` flag to your installation command. For example:
88

99
```shell
10-
npx storybook init --package-manager=npm
10+
npx storybook@latest init --package-manager=npm
1111
```
1212

1313
- Storybook supports Webpack 5 out of the box. If you're upgrading from a previous version, run the following command to enable it:

docs/get-started/installation-problems/ember.mdx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
- Add the `--type ember` flag to the installation command to set up Storybook manually:
22

33
```shell
4-
npx storybook init --type ember
4+
npx storybook@latest init --type ember
55
```
66

77
- During the install process, if you get the following warning message:
@@ -17,7 +17,7 @@ Update the [`@storybook/ember-cli-storybook`](https://www.npmjs.com/package/@sto
1717
- Storybook's CLI provides support for [Yarn](https://yarnpkg.com/), [npm](https://www.npmjs.com/), and [pnpm](https://pnpm.io/) package managers. If you have Yarn installed in your environment but prefer to use another as your default package manager add the `--package-manager` flag to your installation command. For example:
1818

1919
```shell
20-
npx storybook init --package-manager=npm
20+
npx storybook@latest init --package-manager=npm
2121
```
2222

2323
- For other installation issues, check the [Ember README](https://github.com/storybookjs/storybook/tree/next/code/frameworks/ember) for additional instructions.

docs/get-started/installation-problems/html.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
- Add the `--type html` flag to the installation command to set up Storybook manually:
22

33
```shell
4-
npx storybook init --type html
4+
npx storybook@latest init --type html
55
```
66

77
- For other installation issues, check the React README files for additional instructions:
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
- Add the `--type preact` flag to the installation command to set up Storybook manually:
22

33
```shell
4-
npx storybook init --type preact
4+
npx storybook@latest init --type preact
55
```
66

77
- Storybook's CLI provides support for [Yarn](https://yarnpkg.com/), [npm](https://www.npmjs.com/), and [pnpm](https://pnpm.io/) package managers. If you have Yarn installed in your environment but prefer to use another as your default package manager add the `--package-manager` flag to your installation command. For example:
88

99
```shell
10-
npx storybook init --package-manager=npm
10+
npx storybook@latest init --package-manager=npm
1111
```
1212

1313
- For other installation issues, check the [Preact README](https://github.com/storybookjs/storybook/tree/next/code/frameworks/preact-webpack5) for additional instructions.
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
- Add the `--type qwik` flag to the installation command to set up Storybook manually:
22

33
```shell
4-
npx storybook init --type qwik
4+
npx storybook@latest init --type qwik
55
```
66

77
- Storybook's CLI provides support for [Yarn](https://yarnpkg.com/), [npm](https://www.npmjs.com/), and [pnpm](https://pnpm.io/) package managers. If you have Yarn installed in your environment but prefer to use another as your default package manager add the `--package-manager` flag to your installation command. For example:
88

99
```shell
10-
npx storybook init --package-manager=npm
10+
npx storybook@latest init --package-manager=npm
1111
```

docs/get-started/installation-problems/react.mdx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
- Add the `--type react` flag to the installation command to set up Storybook manually:
22

33
```shell
4-
npx storybook init --type react
4+
npx storybook@latest init --type react
55
```
66

77
- Storybook's CLI provides support for [Yarn](https://yarnpkg.com/), [npm](https://www.npmjs.com/), and [pnpm](https://pnpm.io/) package managers. If you have Yarn installed in your environment but prefer to use another as your default package manager add the `--package-manager` flag to your installation command. For example:
88

99
```shell
10-
npx storybook init --package-manager=npm
10+
npx storybook@latest init --package-manager=npm
1111
```
1212

1313
- Storybook supports Webpack 5 out of the box. If you're upgrading from a previous version, run the following command to enable it:

docs/get-started/installation-problems/svelte.mdx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
- Add the `--type svelte` flag to the installation command to set up Storybook manually:
22

33
```shell
4-
npx storybook init --type svelte
4+
npx storybook@latest init --type svelte
55
```
66

77
- Storybook's CLI provides support for [Yarn](https://yarnpkg.com/), [npm](https://www.npmjs.com/), and [pnpm](https://pnpm.io/) package managers. If you have Yarn installed in your environment but prefer to use another as your default package manager add the `--package-manager` flag to your installation command. For example:
88

99
```shell
10-
npx storybook init --package-manager=npm
10+
npx storybook@latest init --package-manager=npm
1111
```
1212

1313
### Svelte Native

docs/get-started/installation-problems/vue.mdx

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22

33
```shell
44
# For Vue 2 projects
5-
npx storybook init --type vue
5+
npx storybook@latest init --type vue
66

77
# For Vue 3 projects
8-
npx storybook init --type vue3
8+
npx storybook@latest init --type vue3
99
```
1010

1111
- Storybook's CLI provides support for [Yarn](https://yarnpkg.com/), [npm](https://www.npmjs.com/), and [pnpm](https://pnpm.io/) package managers. If you have Yarn installed in your environment but prefer to use another as your default package manager add the `--package-manager` flag to your installation command. For example:
1212

1313
```shell
14-
npx storybook init --package-manager=npm
14+
npx storybook@latest init --package-manager=npm
1515
```
1616

1717
- For other installation issues, check the Vue README files for additional instructions:

docs/get-started/installation-problems/web-components.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
- Add the `--type web_components` flag to the installation command to set up Storybook manually:
22

33
```shell
4-
npx storybook init --type web_components
4+
npx storybook@latest init --type web_components
55
```
66

77
- For other installation issues, check the Web Components README files for additional instructions:
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
```shell
2-
npx storybook init
2+
npx storybook@latest init
33
```
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
```shell
2-
pnpm dlx storybook init
2+
pnpm dlx storybook@latest init
33
```

0 commit comments

Comments
 (0)