1
- > ⚠️ This guide is old and may not be still relevant! I'll update this soon. 🙏
2
-
3
1
# Contributing to RetroUI
4
2
5
3
Thank you for your interest in contributing to RetroUI 🙏. I hope this guide to help you get started.
@@ -26,7 +24,7 @@ Thank you for your interest in contributing to RetroUI 🙏. I hope this guide t
26
24
git switch -c new-branch-name
27
25
```
28
26
29
- 5 . nstall dependencies
27
+ 5 . install dependencies
30
28
31
29
``` bash
32
30
pnpm i
@@ -42,46 +40,60 @@ Thank you for your interest in contributing to RetroUI 🙏. I hope this guide t
42
40
1 . Create the main component in ` /packages/ui/NewComponent/NewComponent.tsx `
43
41
44
42
``` ts
45
- import React from ' react'
46
-
47
43
export function NewComponent() {
48
- return (
49
- <div >
50
- This is your component .
51
- < / div >
52
- )
44
+ return <div >This is your component .< / div > ;
53
45
}
54
46
```
55
47
56
48
2 . Export your component in ` /packages/ui/NewComponent/index.ts ` and ` /packages/ui/index.ts `
57
49
58
50
``` ts
59
- export * from " ./NewComponent"
51
+ export * from " ./NewComponent" ;
60
52
```
61
53
62
- 3 . Create basic example to showcase your component in ` app/page .tsx`
54
+ 3 . Create a preview to showcase your component in ` preview/components/new-component .tsx`
63
55
64
56
``` typescript
65
- import React from " react" ;
66
- import { H3 , NewComponent } from " @/packages/ui" ;
67
-
68
- export default function page() {
57
+ export default function NewComponentStyle() {
69
58
return (
70
- < div className = " container max-w-6xl mx-auto" >
71
- <H1 >Welcome to RetroUI < / H1 >
72
-
73
- < div className = " space-y-8 mt-12" >
74
- ...
75
- <div >
76
- <H3 >New Component < / H3 >
77
- < NewComponent / >
78
- < / div >
79
- < / div >
80
- < / div >
59
+ < span className = " px-2.5 py-1 text-sm font-semibold border-2 border-red-600 text-red-600" >
60
+ Error
61
+ < / span >
81
62
);
82
63
}
83
64
```
84
65
66
+ 4 . Add your component preview to the list of components registry in ` config/components.ts `
67
+
68
+ ``` typescript
69
+ export const componentConfig = {
70
+ registry: {
71
+ ...
72
+ " new-component" : {
73
+ name: " new-component" ,
74
+ filePath: " preview/components/new-component.tsx" ,
75
+ preview: lazy (() => import (" @/preview/components/new-component" )),
76
+ },
77
+ },
78
+ };
79
+ ```
80
+
81
+ 5 . Add documentation for your component in ` content/docs/components/...mdx `
82
+
83
+ ``` md
84
+ ---
85
+ title: Badge
86
+ description: The component that looks like a button but isn't clickable!
87
+ lastUpdated: 08 Oct, 2024
88
+ ---
89
+
90
+ ...
91
+
92
+ ### New Component
93
+
94
+ <ComponentShowcase name="new-component" /> // name of the component in the registry
95
+ ```
85
96
86
97
## Ask for Help
87
- For any help or questions, please open a new GitHub issue.
98
+
99
+ For any help or questions, please open a new GitHub issue.
0 commit comments