Thank you for your interest in contributing to RetroUI 🙏. I hope this guide to help you get started.
-
Fork this repository
-
Clone the forked repository to your local machine.
git clone https://github.com/<YOUR_USERNAME>/retroui.git
-
Navigate to the project directory
cd retroui
-
Create a new branch
git switch -c new-branch-name
-
install dependencies
pnpm i
-
Run the project
pnpm dev
- Create the main component in
/packages/ui/NewComponent/NewComponent.tsx
export function NewComponent() {
return <div>This is your component.</div>;
}
- Export your component in
/packages/ui/NewComponent/index.ts
and/packages/ui/index.ts
export * from "./NewComponent";
- Create a preview to showcase your component in
preview/components/new-component.tsx
export default function NewComponentStyle() {
return (
<span className="px-2.5 py-1 text-sm font-semibold border-2 border-red-600 text-red-600">
Error
</span>
);
}
- Add your component preview to the list of components registry in
config/components.ts
export const componentConfig = {
registry: {
...
"new-component": {
name: "new-component",
filePath: "preview/components/new-component.tsx",
preview: lazy(() => import("@/preview/components/new-component")),
},
},
};
- Add documentation for your component in
content/docs/components/...mdx
---
title: Badge
description: The component that looks like a button but isn't clickable!
lastUpdated: 08 Oct, 2024
---
...
### New Component
<ComponentShowcase name="new-component" /> // name of the component in the registry
For any help or questions, please open a new GitHub issue.