@@ -15,30 +15,41 @@ install components because it will also include any dependencies (other referenc
1515
1616To vendor a component into your project using the ` components ` tool, run
1717
18- ``` bash
19- uvx --from basic-components components add < component_name>
20- ```
18+ <Tabs defaultValue =" uv " >
19+ <TabsList className="grid grid-cols-2">
20+ <TabsTrigger value="uv">uv</TabsTrigger>
21+ <TabsTrigger value="pipx">pipx</TabsTrigger>
22+ </TabsList>
23+ <TabsContent value="uv">
24+ <div class="relative" x-data><CopyPasteButton/>
25+ <pre class="language-bash bg-zinc-50 dark:bg-zinc-900 rounded-md"><code x-ref="code" class="language-bash">uvx --from basic-components components add [component_name] </code></pre>
26+ </div>
27+ </TabsContent>
28+ <TabsContent value="pipx">
29+ <div class="relative" x-data><CopyPasteButton/>
30+ <pre class="language-bash bg-zinc-50 dark:bg-zinc-900 rounded-md"><code x-ref="code" class="language-bash">pipx install basic-components && components add [component_name]</code></pre>
31+ </div>
32+ </TabsContent>
33+ </Tabs >
2134
2235The components will be added to your project in the ` components/ui/<component_name> ` directory.
2336
2437### Example
2538
2639``` bash
27- ➜ uvx --from basic- components components add button
28- Installing button from
29- ' https://github.com/basicmachines-co/basic-components.git ' ...
40+ ✗ components add button
41+ button (will be installed)
42+ Installing button ...
3043
31- Copying from template version 0.0.0.post163.dev0+70554ca
32- create button
44+ Copying from template version 0.2.0
3345 create button/Button.jinja
3446
3547
36- ╭─────────────────────────── Installation Complete ────────────────────────────╮
37- │ ✓ Added button component │
38- │ │
39- │ components-dir=components/ui │
40- ╰──────────────────────────────────────────────────────────────────────────────╯
41-
48+ ╭────────────────────────────────────────────────────────── Installation Complete ───────────────────────────────────────────────────────────╮
49+ │ ✓ Added button component │
50+ │ │
51+ │ components-dir=components/ui │
52+ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
4253```
4354View the results
4455``` bash
@@ -52,7 +63,64 @@ components
5263
5364```
5465
55- See the [ utilities] ( /docs/utilities ) docs for more information about setting up your project to use the components.
66+ ### Dependencies
67+
68+ Some components have dependencies on other components. When using the ` components ` command, any required components
69+ will also be installed.
70+
71+ ``` bash
72+ ✗ components add dropdown_menu
73+ dropdown_menu (will be installed)
74+ └── Dependencies
75+ ├── checkbox
76+ ├── icons/ChevronRight
77+ └── radio
78+ Installing checkbox...
79+
80+ Copying from template version 0.2.0
81+ create checkbox/Checkbox.jinja
82+
83+
84+ Installing dropdown_menu...
85+
86+ Copying from template version 0.2.0
87+ create dropdown_menu/DropdownMenuItem.jinja
88+ create dropdown_menu/DropdownMenu.jinja
89+ create dropdown_menu/DropdownMenuSubTrigger.jinja
90+ create dropdown_menu/DropdownMenuTrigger.jinja
91+ create dropdown_menu/DropdownMenuRadioItem.jinja
92+ create dropdown_menu/DropdownMenuGroup.jinja
93+ create dropdown_menu/DropdownMenuSub.jinja
94+ create dropdown_menu/DropdownMenuSeparator.jinja
95+ create dropdown_menu/DropdownMenuContent.jinja
96+ create dropdown_menu/DropdownMenuSubContent.jinja
97+ create dropdown_menu/DropdownMenuLabel.jinja
98+ create dropdown_menu/DropdownMenuCheckboxItem.jinja
99+
100+
101+ Installing icons/ChevronRight...
102+
103+ Copying from template version 0.2.0
104+ create icons/ChevronRightIcon.jinja
105+
106+
107+ Installing radio...
108+
109+ Copying from template version 0.2.0
110+ create radio/RadioGroupItem.jinja
111+ create radio/RadioGroup.jinja
112+
113+
114+ ╭────────────────────────────────────────────────────────── Installation Complete ───────────────────────────────────────────────────────────╮
115+ │ ✓ Added dropdown_menu component │
116+ │ Installed dependencies: │
117+ │ - dropdown_menu │
118+ │ - icons/ChevronRight │
119+ │ - radio │
120+ │ │
121+ │ components-dir=components/ui │
122+ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
123+ ```
56124
57125### Components cli tool
58126
@@ -82,32 +150,8 @@ Code for components can also be copy/pasted directly from the example pages via
82150anywhere in you project. The rest of the information in these docs assume they are located in the ` components/ui ` dir in
83151your project. See the [ JinjaX] ( /docs/utilities#jinjax ) docs for more info on how to set up components in your project.
84152
85- ## Other tools
86-
87- If you don't want to use ` uv ` , then you can also use the ` components ` cli by installing it using ` pip ` or ` poetry ` . This
88- will only install the libs needed for the cli, not the actual components.
89-
90- ### Pip
91- ``` bash
92- pip install basic-components
93- ```
94-
95- To use the ` components ` tool, you can run
96-
97- ``` bash
98- pipx run components add < component>
99- ```
100-
101- ### Poetry
102- ``` bash
103- poetry add basic-components
104- ```
105-
106- To use the ` components ` tool, you can run
107-
108- ``` bash
109- poetry run components add < component>
110- ```
153+ ## Next steps
111154
155+ See the [ utilities] ( /docs/utilities ) docs for more information about setting up your project to use the components.
112156
113157</Prose >
0 commit comments