Skip to content

Commit 3204f8b

Browse files
authored
Merge pull request #2320 from gluestack/fix/installation-docs
fix: installation docs
2 parents cefb28b + 7889ca3 commit 3204f8b

File tree

1 file changed

+26
-17
lines changed

1 file changed

+26
-17
lines changed

example/storybook-nativewind/src/home/getting-started/Installation/index.nw.stories.mdx

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,6 @@ import { CollapsibleCode, Tabs } from '@gluestack/design-system';
1919

2020
To get started with **gluestack-ui v2**, check out this quick installation guide. It provides simple steps to help you install and use the library in your projects.
2121

22-
23-
### Step 1: Setup your project.
24-
25-
Setup your project with [Next.js](https://nextjs.org/docs/getting-started/installation) or [Expo](https://docs.expo.dev/get-started/create-a-project/).
26-
27-
28-
### Step 2: Initialize
29-
3022
<br />
3123

3224
<Tabs value="cli" type="section">
@@ -44,18 +36,33 @@ Setup your project with [Next.js](https://nextjs.org/docs/getting-started/instal
4436

4537
<br />
4638

39+
### Step 1: Initialize
40+
4741
Use `init` command to add `GluestackUIProvider` and `gluestack-ui-provider/config.ts` file into your project.
4842

4943
```bash
5044
npx gluestack-ui init
5145
```
5246

47+
Your project is now ready to use **gluestack-ui** components. To add gluestack-ui components to your project using the CLI, refer to the above command or use the [CLI guide](/ui/docs/home/getting-started/cli).
48+
49+
```bash
50+
npx gluestack-ui add box
51+
```
52+
53+
If you encounter issues during the CLI installation, refer to the manual installation guide available.
54+
5355
</>
5456
</Tabs.TabPanel>
5557
<Tabs.TabPanel value="manual">
5658
<>
59+
<br />
5760

58-
### Step 2.1: Install dependencies
61+
### Step 1: Setup your project.
62+
63+
Setup nativewind in your project following [NativeWind documentation](https://www.nativewind.dev/v4/getting-started/react-native).
64+
65+
### Step 2: Install dependencies
5966

6067
Install the dependencies of gluestack-ui in your project. This can be done using the following command:
6168

@@ -71,15 +78,15 @@ npm i @gluestack-ui/nativewind-utils
7178

7279
```
7380

74-
### Step 2.2: Update Tailwind configuration
81+
### Step 2.1: Update Tailwind configuration
7582

7683
Update `tailwind.config.js` file with the following code
7784

7885
```js
7986
%%-- File: tailwind.config.js --%%
8087
```
8188

82-
### Step 2.3: Configure components path
89+
### Step 2.2: Configure components path
8390

8491
Create a `components/ui` folder inside `src` folder and add path in `tsconfig.json`
8592

@@ -94,7 +101,7 @@ Create a `components/ui` folder inside `src` folder and add path in `tsconfig.js
94101
}
95102
```
96103

97-
### Step 2.4: Configure GluestackUIProvider
104+
### Step 2.3: Configure GluestackUIProvider
98105

99106
To add config, create a `gluestack-ui-provider/config.ts` file in your `components/ui` folder and paste the following code.
100107

@@ -128,11 +135,6 @@ To add `GluestackUIProvider`, create a `gluestack-ui-provider/index.web.tsx` fil
128135

129136
</CollapsibleCode>
130137

131-
</>
132-
</Tabs.TabPanel>
133-
</Tabs.TabPanels>
134-
</Tabs>
135-
136138
### Step 3: Configure GluestackUIProvider in project
137139

138140
Wrap your app with `GluestackUIProvider` in `App.tsx`.
@@ -162,6 +164,7 @@ It's also recommended to set up your server-side rendering (SSR) correctly. To d
162164
<Tabs.TabPanels>
163165
<Tabs.TabPanel value="App Router">
164166
<>
167+
<br/>
165168

166169
For Next.js App Routers we will create a new `registry.tsx` file in the root of your project and use the flush function from `@gluestack-ui/nativewind-utils`
167170

@@ -239,6 +242,7 @@ export default function RootLayout({
239242
</Tabs.TabPanel>
240243
<Tabs.TabPanel value="Page Router">
241244
<>
245+
<br/>
242246

243247

244248
For Next.js we will add this code in `_document.tsx` file.
@@ -277,6 +281,11 @@ export default Document;
277281
</Tabs.TabPanels>
278282
</Tabs>
279283

284+
</>
285+
</Tabs.TabPanel>
286+
</Tabs.TabPanels>
287+
</Tabs>
288+
280289
## Common issues
281290
**Expo app stuck in `tailwindcss(ios) rebuilding...` while running `expo start` command**
282291

0 commit comments

Comments
 (0)