Skip to content

Commit e22dceb

Browse files
committed
update list layout
1 parent 4473001 commit e22dceb

File tree

1 file changed

+29
-14
lines changed

1 file changed

+29
-14
lines changed

docs/recipes/ui/add-shadcn.md

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,16 @@ Integrating Feliz.Shadcn into your SAFE Stack application is straightforward. Th
44

55
We will be using the [Feliz.Shadcn](https://github.com/reaptor/feliz.shadcn) wrapper written by [reaptor](https://github.com/reaptor)
66

7-
1. Setup Tailwind
7+
#### 1. Setup Tailwind
8+
> Note: When you use the SAFE template you will already have Tailwind installed by default. You can skip this step.
89
9-
> Note: When you use the SAFE template you will already have Tailwind installed by default. You can skip this step.
10+
Check out the following recipe here to install Tailwind: [Add Tailwind](https://safe-stack.github.io/docs/recipes/ui/add-tailwind/)
1011

11-
Check out the following recipe here to install tailwind: [Add Tailwind](https://safe-stack.github.io/docs/recipes/ui/add-tailwind/)
12+
#### 2. Move `package.json` & `package-lock.json` to `/src/Client`
1213

13-
1. Move `package.json` & `package-lock.json` to /src/Client
14+
#### 3. Configure import alias in tsconfig:
1415

15-
1. Configure import alias in tsconfig:
16-
17-
Create a file named tsconfig.json in `/src/Client` and add the following:
16+
Create a file named `tsconfig.json` in `/src/Client` and add the following:
1817

1918
```json
2019
{
@@ -30,7 +29,23 @@ Create a file named tsconfig.json in `/src/Client` and add the following:
3029
}
3130
```
3231

33-
1. Install shadcn/ui
32+
#### 4. Update the `vite.config.mts` within `/src/Client`
33+
34+
Add the `resolve` property below under the `defineConfig`
35+
36+
```
37+
export default defineConfig({
38+
...
39+
resolve: {
40+
alias: {
41+
"@": path.resolve(__dirname),
42+
},
43+
},
44+
...
45+
});
46+
```
47+
48+
#### 5. Install shadcn/ui
3449

3550
> Note: ensure your node version is > 20.5.0
3651
@@ -40,34 +55,34 @@ npx shadcn@latest init
4055

4156
You will be asked a few questions to configure components.json
4257

43-
1. Add Feliz.Shadcn
58+
#### 6. Add Feliz.Shadcn
4459

4560
Inside the `/src/Client` directory run:
4661

4762
```
4863
dotnet add package Feliz.Shadcn
4964
```
5065

51-
1. Start adding any shadcn component
66+
#### 7. Start adding any shadcn component
5267

5368
Specify first which components you want to use.
5469
You can find the list of available components [here](https://reaptor.github.io/Feliz.Shadcn/):
5570

5671
```
57-
npx shadcn@latest add button
72+
npx shadcn@latest add button
5873
```
5974

60-
1. Then use it in Feliz:
75+
#### 8. Use it in Feliz:
6176

6277
```fsharp
6378
open Feliz.Shadcn
6479
6580
66-
let view =
81+
let view =
6782
Shadcn.button [
6883
prop.text "Button" ]
6984
7085
```
7186

7287
Congratulations, now you can use shadcn components!
73-
Documentation can be found at [https://reaptor.github.io/Feliz.Shadcn/](https://reaptor.github.io/Feliz.Shadcn/)
88+
Further documentation can be found at [https://reaptor.github.io/Feliz.Shadcn/](https://reaptor.github.io/Feliz.Shadcn/)

0 commit comments

Comments
 (0)