Skip to content
This repository was archived by the owner on Apr 5, 2026. It is now read-only.

Commit 7b2ac4c

Browse files
author
phernandez
committed
chore: more docs cleanup for installing basic-components
1 parent 70554ca commit 7b2ac4c

4 files changed

Lines changed: 260 additions & 39 deletions

File tree

docs/content/docs/cli.md

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ your project. See the [JinjaX](/docs/utilities#jinjax) docs for more info.
1717

1818
The components in this project can also be copied (vendored) directly into your project using the `components` tool
1919
in the `basic-components` package via `uv`. You can then customize them as needed. This is the recommendedd way to
20-
install components because it will also include any dependencies (other component dependencies) required.
20+
install components because it will also include any dependencies (other referenced components) required.
2121

2222
To vendor a component into your project using the `components` tool:
2323

@@ -27,24 +27,55 @@ uvx --from basic-components add <component_name>
2727

2828
The components will be added to your project in the `components/ui/<component_name>` directory.
2929

30-
See the [utilities](/docs/utilities) docs for more information.
30+
### Example
31+
32+
```bash
33+
➜ uvx --from basic-components components add button
34+
Installing button from
35+
'https://github.com/basicmachines-co/basic-components.git' ...
36+
37+
Copying from template version 0.0.0.post163.dev0+70554ca
38+
create button
39+
create button/Button.jinja
40+
41+
42+
╭─────────────────────────── Installation Complete ────────────────────────────╮
43+
│ ✓ Added button component │
44+
│ │
45+
│ components-dir=components/ui │
46+
╰──────────────────────────────────────────────────────────────────────────────╯
47+
48+
```
49+
View the results
50+
```bash
51+
➜ tree components
52+
components
53+
└── ui
54+
└── button
55+
└── Button.jinja
56+
57+
2 directories, 1 file
58+
59+
```
60+
61+
See the [utilities](/docs/utilities) docs for more information about setting up your project to use the components.
3162

3263
### Components cli tool
3364

3465
The `components` cli tool has several options.
3566

3667
Add a component
37-
```
68+
```bash
3869
uvx --from basic-components add button
3970
```
4071

4172
Add a component, specifying the repo
42-
```
73+
```bash
4374
uvx --from basic-components add button --repo-url https://github.com/basicmachines-co/basic-components.git
4475
```
4576

4677
Add a component, specifying the repo and branch or tag
47-
```
78+
```bash
4879
uvx --from basic-components add button --repo-url https://github.com/basicmachines-co/basic-components.git --branch main
4980
```
5081

docs/content/docs/installation.md

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,42 @@ description: How to install dependencies.
55

66
<Prose>
77

8+
## Install JinjaX
89

9-
## Configure components in your project
10+
```bash
11+
uv add jinjax
12+
```
13+
14+
JinjaX is the only required python dependency to use basic-components. However, the `basic-components` includes several
15+
[helper functions](/docs/utilities) to set up the JinjaX template environment and merge tailwind classes within components.
16+
17+
## Install basic-components
1018

11-
You can install `basic-components` utilities into your project using your package manager.
12-
Basic components includes several [helper functions](/docs/utilities) to setup the
13-
JinjaX template environment and merge tailwind classes within components.
19+
You can install `basic-components` utilities into your project using your package manager.
1420

1521
Installing the basic-components package is **optional**.
1622

1723
```bash
18-
uv add basic-components
24+
uv add basic-components[utils]
1925
```
26+
This will only add the python functions in the [utils](https://github.com/basicmachines-co/basic-components/tree/main/basic_components)
27+
directory of the project. Components should be added via the [cli](/docs/cli).
2028

21-
**Note**: Using `uv` is optional. You can also use install via `pip` or `poetry`. [UV](https://docs.astral.sh/uv/) is
29+
30+
**Note**:
31+
32+
Using `uv` is also optional. You can also use install via `pip` or `poetry`. [UV](https://docs.astral.sh/uv/) is
2233
used in these examples because it enables componets to be vendored directly into your project via the [components](/docs/cli) cli.
2334

24-
You can also add the code for the [helper functions](/docs/utilities) directly to your codebase if you want to add an
35+
You can also add the code for the [helper functions](/docs/utilities) directly to your codebase if you don't want to add an
2536
extra dependency.
2637

27-
Be sure to:
38+
**Be sure to**:
39+
2840
- add the `cn` global function so it is available to all Jinja templates
2941
- configure the `jinjax.Catalog` to load components from the directories under your `components` dir.
3042

31-
Configure your Jinja environment to load the components according to the [JinjaX docs](https://jinjax.scaletti.dev/guide/). You can also refer to the examples for [FastAPI](/docs/fastapi), [Django](/docs/django), or [Flask](/docs/flask).
43+
You can also refer to the examples for [FastAPI](/docs/fastapi), [Django](/docs/django), or [Flask](/docs/flask).
3244

3345
## Tailwind CSS
3446

pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ dependencies = [
5757
utils = [
5858
"jinjax>=0.47",
5959
"jinja2>=3.1.3",
60-
"tomli>=2.0.2",
6160
]
6261

6362
docs = [
@@ -134,4 +133,4 @@ style = "default"
134133
[tool.pytest.ini_options]
135134
testpaths = ["tests"]
136135
python_files = ["test_*.py"]
137-
addopts = "-ra -q"
136+
addopts = "-ra -q"

0 commit comments

Comments
 (0)