@@ -7,17 +7,10 @@ description: Use the CLI to add Plate UI components to your project.
7
7
8
8
Use the ` init ` command to initialize configuration and dependencies for a new project with Plate UI.
9
9
10
- The ` init ` command installs dependencies, adds the ` cn ` util, configures ` tailwind.config.js ` , and CSS variables for the project.
10
+ The ` init ` command installs dependencies, configures ` tailwind.config.js ` , and CSS variables for the project.
11
11
12
12
``` bash
13
- npx shadcx@latest init -u https://platejs.org/r -n plate
14
- ```
15
-
16
- If you also want to use [ shadcn/ui] ( https://ui.shadcn.com/ ) in your project, you can use the following command:
17
-
18
- ``` bash
19
- npx shadcx@latest init
20
- npx shadcx@latest init -u https://platejs.org/r -n plate
13
+ npx shadcx@latest init plate
21
14
```
22
15
23
16
You will be asked a few questions to configure ` components.json ` :
@@ -30,7 +23,7 @@ Do you want to use CSS variables for colors? › yes
30
23
### Options
31
24
32
25
``` txt
33
- Usage: shadcx init [options]
26
+ Usage: shadcx init [options] [registry]
34
27
35
28
initialize your project and install dependencies
36
29
@@ -39,10 +32,10 @@ Options:
39
32
-f, --force force overwrite of existing components.json. (default: false)
40
33
-y, --yes skip confirmation prompt. (default: false)
41
34
-c, --cwd <cwd> the working directory. defaults to the current directory.
42
- -u, --url <url> custom registry URL. (default: https://platejs.org/r)
43
35
-n, --name <name> registry name. (default: plate)
44
36
-s, --silent mute output (default: false)
45
37
--src-dir use the src directory when creating a new project (default: false)
38
+ --pm <pm> package manager to use (npm, pnpm, yarn, bun)
46
39
-h, --help display help for command
47
40
```
48
41
@@ -51,7 +44,14 @@ Options:
51
44
Use the ` add ` command to add Plate UI components and dependencies to your project.
52
45
53
46
``` bash
54
- npx shadcx@latest add [component] -r plate
47
+ # Using prefix syntax
48
+ npx shadcx@latest add plate/editor plate/toolbar
49
+
50
+ # Or mixed usage (registry will be from the first prefix found)
51
+ npx shadcx@latest add plate/editor toolbar
52
+
53
+ # Or using registry option
54
+ npx shadcx@latest add editor toolbar -r plate
55
55
```
56
56
57
57
You will be presented with a list of components to choose from:
@@ -99,13 +99,13 @@ Options:
99
99
In a monorepo, you can specify the path to your workspace with the ` -c ` or ` --cwd ` option.
100
100
101
101
``` bash
102
- npx shadcx@latest init -u https://platejs.org/r -n plate -c ./apps/www
102
+ npx shadcx@latest init plate -c ./apps/www
103
103
```
104
104
105
105
or
106
106
107
107
``` bash
108
- npx shadcx@latest add align-dropdown-menu -r plate -c ./apps/www
108
+ npx shadcx@latest add plate/editor -c ./apps/www
109
109
```
110
110
111
111
## Example components.json
@@ -114,24 +114,30 @@ Here's an example `components.json` file configured for [shadcn/ui](https://ui.s
114
114
115
115
``` json
116
116
{
117
+ "$schema" : " https://ui.shadcn.com/schema.json" ,
117
118
"style" : " default" ,
118
- "tailwind" : {
119
- "config" : " tailwind.config.js" ,
120
- "css" : " app/globals.css" ,
121
- "baseColor" : " slate" ,
122
- "cssVariables" : true
123
- },
119
+ "rsc" : true ,
120
+ "tsx" : true ,
124
121
"aliases" : {
125
122
"components" : " @/components" ,
123
+ "hooks" : " @/hooks" ,
124
+ "lib" : " @/lib" ,
125
+ "ui" : " @/components/ui" ,
126
126
"utils" : " @/lib/utils"
127
127
},
128
+ "tailwind" : {
129
+ "baseColor" : " slate" ,
130
+ "config" : " tailwind.config.ts" ,
131
+ "css" : " src/app/globals.css" ,
132
+ "cssVariables" : true ,
133
+ "prefix" : " "
134
+ },
128
135
"registries" : {
129
136
"plate" : {
130
- "url" : " https://platejs.org/r" ,
131
- "style" : " default" ,
132
137
"aliases" : {
133
138
"ui" : " @/components/plate-ui"
134
- }
139
+ },
140
+ "url" : " https://platejs.org/r"
135
141
}
136
142
}
137
143
}
0 commit comments