@@ -32,15 +32,13 @@ npm install @ark-ui/react
32
32
</Step >
33
33
<Step number = " 3" title = " Install the Panda Presets" >
34
34
35
- The next package you will need is ` @park-ui/panda-preset ` . This package contains all the recipes and tokens explicitly
36
- built for Ark UI's headless components.
35
+ The next package you'll need is ` @park-ui/panda-preset ` . It extends the Panda Base Preset with advanced color options and opinionated design tokens.
37
36
38
37
``` bash
39
38
npm install @park-ui/panda-preset -D
40
39
```
41
40
42
- After you've installed the presets, you'll need to add it to your Panda configuration file along with your preferred
43
- ` jsxFramework ` like shown below:
41
+ Next, update your Panda config file to include the preset and set your preferred ` jsxFramework ` , as shown below:
44
42
45
43
``` tsx multi
46
44
import { defineConfig } from ' @pandacss/dev'
@@ -57,7 +55,7 @@ export default defineConfig({
57
55
})
58
56
```
59
57
60
- > Ensure you run ` panda codegen ` after adding the presets to your Panda configuration file.
58
+ > Don't forget to run ` panda codegen ` after updating your configuration
61
59
62
60
</Step >
63
61
<Step number = " 4" title = " Path Aliases" >
@@ -89,47 +87,69 @@ export default defineConfig({
89
87
90
88
</Step >
91
89
92
- <Step number = " 5" title = " Adding Components to Your Project " >
90
+ <Step number = " 5" title = " Add your first component " >
93
91
94
- We recommend storing your components in the ` ~/components/ui ` directory.
95
- Here's an example how a project structure might look like:
96
-
97
- ``` bash
98
- ➜ /src/components/ui/
99
- | -- styled/
100
- | | -- utils/
101
- | | ` -- create-style-context.ts
102
- | ` -- button.tsx
103
- ` -- button.tsx
104
- ` ` `
105
-
106
- Although you can manually add components, we recommend using the Park UI CLI for efficiency.
107
- To add a single component, run:
92
+ Use the Park UI CLI to add your first component. For example, to add a button, run:
108
93
109
94
``` bash
110
95
npx @park-ui/cli components add button
111
96
```
112
97
113
- If a ` park-ui.json ` file is not found in your project, the CLI will prompt you to set up the configuration by asking :
98
+ If it's your first time running the CLI, you'll be prompted to configure :
114
99
115
100
``` txt
116
101
- Which JS framework do you use? [React / Solid / Vue]
117
102
- Where would you like to store your components? [./src/components/ui]
103
+ - Where would you like to store your recipes? [./src/theme/recipes]
104
+ ```
105
+
106
+ After adding the button, your folder structure should resemble this:
107
+
108
+ ``` bash
109
+ ➜ /src/
110
+ | -- components/
111
+ | ` -- ui/
112
+ | | -- styled/
113
+ | | | -- utils/
114
+ | | | ` -- create-style-context.ts
115
+ | | ` -- button.tsx
116
+ | ` -- button.tsx
117
+ ` -- theme/
118
+ ` -- recipes/
119
+ | -- button.tsx
120
+ ` -- index.ts
121
+ ` ` `
122
+
123
+ Update the ` panda.config.ts` file to include the recipes:
124
+
125
+ ` ` ` tsx
126
+ // other imports
127
+ import { recipes, slotRecipes } from ' ~/theme/recipes'
128
+
129
+ export default defineConfig({
130
+ // other configuration
131
+ theme: {
132
+ extend: {
133
+ recipes,
134
+ slotRecipes,
135
+ },
136
+ },
137
+ })
118
138
` ` `
119
139
120
- To add multiple components at once, separate their names with spaces:
140
+ To add multiple components at once, list them separated by spaces:
121
141
122
142
` ` ` bash
123
143
npx @park-ui/cli components add avatar button card
124
144
` ` `
125
145
126
- To add all available components at once, use the ` --all` flag:
146
+ Or use the ` --all` flag to install all available components :
127
147
128
148
` ` ` bash
129
149
npx @park-ui/cli components add --all
130
150
` ` `
131
151
132
- And that ' s it! Happy hacking! ✌️
152
+ That ' s it! Happy hacking! ✌️
133
153
134
154
</Step>
135
155
</Steps>
0 commit comments