Thank you for your interest in contributing to RigidUI! This document provides guidelines and instructions for contributing to this project.
- Code of Conduct
- Development Setup
- Project Structure
- Component Guidelines
- Pull Request Process
- Commit Guidelines
- Creating a New Component
Please read and follow our Code of Conduct to foster an inclusive and respectful community.
To set up the development environment:
- Fork and clone the repository:
git clone https://github.com/fgrreloaded/rigidui.git
cd rigidui- Install dependencies:
pnpm install- Start the development server:
pnpm run dev- Build the registry:
pnpm run buildrigidui/
├── app/ # Next.js app directory
│ ├── docs/ # Documentation pages
│ ├── registry/ # Registry API route
│ └── page.tsx # Homepage
├── components/ # Shared components
├── registry/ # Registry components
│ ├── new-york/ # New York style components
│ │ ├── component-name/ # Individual component directories
│ │ │ ├── component-name.tsx # Main component file
│ │ │ └── component-name-demo.tsx # Demo component (optional)
├── lib/ # Utility functions and hooks
├── registry.json # Registry configuration file
└── tailwind.config.ts # Tailwind configuration
When developing components for RigidUI, please follow these guidelines:
- Self-contained - Components should be self-contained with minimal external dependencies.
- Accessible - Follow WAI-ARIA guidelines and ensure keyboard navigation works.
- Responsive - Components should work well on all screen sizes.
- Customizable - Use Tailwind CSS classes and accept className props.
- TypeScript - Write proper TypeScript types for all props and functions.
- Dark Mode - Support both light and dark modes.
- Documentation - Include proper JSDoc comments and create demo files.
-
Create a branch with a descriptive name:
git checkout -b feature/component-name
-
Make your changes following the component guidelines.
-
Test your changes thoroughly.
-
Update documentation if necessary.
-
Create a changeset to document your changes:
npx changeset
Follow the prompts to describe your changes.
-
Commit your changes following the commit guidelines.
-
Push your branch to your fork:
git push origin feature/component-name
-
Create a pull request to the
mainbranch of the original repository. -
Respond to feedback from maintainers if requested.
We follow Conventional Commits for our commit messages:
feat:- A new featurefix:- A bug fixdocs:- Documentation changesstyle:- Code style changes (formatting, etc.)refactor:- Code changes that neither fix bugs nor add featuresperf:- Performance improvementstest:- Adding or updating testschore:- Changes to the build process or auxiliary tools
Example:
feat(currency-manager): add support for custom decimal places
-
Create a new directory in
registry/new-york/with your component name. -
Create the component file with TypeScript and JSDoc comments:
// filepath: registry/new-york/your-component/your-component.tsx
"use client";
import React from "react";
import { cn } from "@/lib/utils";
export interface YourComponentProps {
/** Description of prop */
someProp?: string;
/** Additional class names */
className?: string;
/** Children elements */
children?: React.ReactNode;
}
/**
* YourComponent - Description of what it does
*/
export function YourComponent({
someProp = "default",
className,
children,
}: YourComponentProps) {
return (
<div className={cn("your-default-classes", className)}>
{/* Component implementation */}
{children}
</div>
);
}- Create a demo file (optional but recommended):
// filepath: registry/new-york/your-component/your-component-demo.tsx
"use client";
import React from "react";
import { YourComponent } from "./your-component";
export function YourComponentDemo() {
return (
<div className="space-y-8">
<YourComponent someProp="value">Demo content</YourComponent>
{/* Add more examples with different props */}
</div>
);
}- Add your component to the registry by updating
registry.json:
{
"name": "your-component",
"type": "registry:component",
"title": "Your Component",
"description": "Description of your component",
"registryDependencies": [
"button" // Add any dependencies here
],
"files": [
{
"path": "registry/new-york/your-component/your-component.tsx",
"type": "registry:component"
}
],
"author": "Your Name <your.email@example.com>"
}- Create documentation in
app/docs/components/your-component/page.tsx
Thank you for contributing to RigidUI!