Thank you for your interest in contributing to RayUI! We're excited to have you join our community of developers building beautiful, accessible UI components.
This guide will help you get started with contributing to the RayUI project.
- Code of Conduct
- Getting Started
- Development Setup
- Project Structure
- Adding New Components
- Contribution Workflow
- Code Guidelines
- Testing
- Documentation
- Community
By participating in this project, you agree to:
- Be respectful and inclusive
- Provide constructive feedback
- Focus on what's best for the community
- Show empathy towards other community members
Before you begin, ensure you have the following installed:
- Node.js 18+ - Download here
- npm or Bun - Package manager (Bun recommended for faster performance)
- Git - Version control
-
Fork the repository on GitHub
- Visit https://github.com/Rayquilib/RayUI
- Click the "Fork" button in the top right
-
Clone your fork to your local machine:
git clone https://github.com/YOUR_USERNAME/RayUI.git cd RayUI -
Add upstream remote to keep your fork in sync:
git remote add upstream https://github.com/Rayquilib/RayUI.git
Install dependencies using npm or Bun:
# Using npm
npm install
# Using Bun (recommended)
bun installStart the development server:
# Using npm
npm run dev
# Using Bun
bun run devThe application will be available at http://localhost:3000
# Development
npm run dev # Start development server with Turbopack
npm run build # Build the production application
npm run start # Start production server
# Registry Management
npm run generate:registry # Generate registry.json from components
npm run generate:markdown # Generate MDX documentation files
npm run validate:registry # Validate registry structure and schema
# Code Quality
npm run lint # Lint codebase
npm run format # Format code with PrettierUnderstanding the project structure will help you navigate and contribute effectively:
RayUI/
├── app/ # Next.js App Router
│ ├── (home)/ # Homepage
│ ├── blocks/ # Component showcase
│ ├── docs/ # Documentation pages
│ └── ... # Other pages (about, contact, etc.)
│
├── components/ # Shared React components
│ ├── ui/ # Base UI components (shadcn/ui)
│ ├── header.tsx # Site header
│ ├── footer.tsx # Site footer
│ └── ... # Other shared components
│
├── content/
│ ├── components/ # Component implementations
│ │ ├── ai/ # AI components
│ │ ├── login/ # Login components
│ │ ├── dialogs/ # Dialog components
│ │ └── ... # Other categories
│ ├── markdown/ # Generated MDX documentation
│ ├── blocks-metadata.ts # Component metadata registry
│ └── blocks-categories.tsx # Category definitions
│
├── lib/ # Utility functions
│ ├── utils.ts # General utilities
│ ├── blocks.ts # Block/component utilities
│ └── ...
│
├── public/
│ ├── r/ # Registry JSON files
│ ├── thumbnails/ # Component thumbnails
│ └── ... # Static assets
│
├── scripts/ # Build and automation scripts
│ ├── generate-registry.ts # Registry generation
│ ├── generate-markdown.ts # Documentation generation
│ └── ...
│
└── config/ # Configuration files
└── site.ts # Site configuration
Create your component file in the appropriate category:
content/components/{category}/{component-name}.tsxExample:
content/components/login/login-10.tsxUse this template for your component:
"use client";
import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
// ... other imports
export default function LoginTen() {
return (
<div className="flex min-h-screen items-center justify-center">
{/* Your component code */}
</div>
);
}Add your component metadata to content/blocks-metadata.ts:
{
name: "login-10",
type: "registry:block",
registryDependencies: ["button", "input"],
files: [
{
path: "content/components/login/login-10.tsx",
type: "registry:block",
target: "",
},
],
category: "login",
subcategory: "Authentication",
description: "A modern login form with social authentication",
}Add the component mapping in content/blocks-components.tsx:
import LoginTen from "./components/login/login-10";
export const blocksComponents: Record<string, React.ComponentType> = {
// ... existing components
"login-10": LoginTen,
};Export your component in content/components/{category}/index.ts:
export { default as LoginTen } from "./login-10";Run the registry generation script:
npm run generate:registryThis will:
- Generate the registry JSON file
- Create MDX documentation
- Update the component showcase
Before starting work, sync your fork with the upstream repository:
git checkout main
git fetch upstream
git merge upstream/mainCreate a new branch for your contribution:
git checkout -b feature/your-feature-name
# or
git checkout -b fix/bug-descriptionBranch naming conventions:
feature/- New featuresfix/- Bug fixesdocs/- Documentation updatesrefactor/- Code refactoringstyle/- UI/styling changes
- Write clean, readable code
- Follow the existing code style
- Add comments where necessary
- Ensure accessibility standards
# Build the project
npm run build
# Test locally
npm run devVerify:
- ✅ Component renders correctly
- ✅ Responsive design works
- ✅ Dark mode support
- ✅ Accessibility (keyboard navigation, screen readers)
- ✅ No console errors
Write clear, descriptive commit messages:
git add .
git commit -m "feat: add new login component with social auth"Commit message format:
feat:- New featurefix:- Bug fixdocs:- Documentation changesstyle:- Code style changesrefactor:- Code refactoringtest:- Adding testschore:- Maintenance tasks
git push origin feature/your-feature-name- Go to the RayUI repository
- Click "New Pull Request"
- Select your fork and branch
- Fill in the PR template with:
- Clear description of changes
- Screenshots (if UI changes)
- Related issues (if any)
- Submit the pull request
-
Accessibility First
- Use semantic HTML
- Include ARIA labels
- Ensure keyboard navigation
- Test with screen readers
-
Responsive Design
- Mobile-first approach
- Use Tailwind responsive classes
- Test on multiple screen sizes
-
Dark Mode Support
- Use Tailwind dark mode classes
- Test in both light and dark themes
-
Performance
- Optimize images
- Minimize bundle size
- Use React best practices
- TypeScript: Use TypeScript for type safety
- Formatting: Use Prettier (automatic on save)
- Naming:
- Components: PascalCase (
LoginForm) - Files: kebab-case (
login-form.tsx) - Variables: camelCase (
isLoading)
- Components: PascalCase (
- Imports: Group and order imports logically
"use client";
// External imports
import { useState } from "react";
import { motion } from "motion/react";
// UI component imports
import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
// Icon imports
import { IconMail } from "@tabler/icons-react";
// Utility imports
import { cn } from "@/lib/utils";
export default function ComponentName() {
// State
const [value, setValue] = useState("");
// Handlers
const handleSubmit = () => {
// Logic
};
// Render
return (
<div className="container">
{/* Component JSX */}
</div>
);
}Before submitting a PR, ensure:
- Component renders without errors
- Responsive on mobile, tablet, desktop
- Works in light and dark mode
- Keyboard accessible
- No console warnings/errors
- Follows design guidelines
- Documentation is clear
Test your component in:
- Chrome/Edge (latest)
- Firefox (latest)
- Safari (latest)
Each component should include:
- Description: What the component does
- Usage Example: How to use it
- Props: If applicable
- Dependencies: Required packages
- Accessibility Notes: ARIA labels, keyboard support
Documentation is auto-generated from metadata, but you can enhance it by:
- Adding usage examples
- Including best practices
- Noting common pitfalls
- GitHub Discussions: Ask questions and share ideas
- Issues: Report bugs or request features
- Twitter: Follow @rayyanquantum
Contributors will be:
- Listed in our README
- Mentioned in release notes
- Featured on our website (coming soon)
By contributing to RayUI, you agree that your contributions will be licensed under the MIT License.
Thank you for contributing to RayUI! Your efforts help make this library better for everyone.
If you have any questions, feel free to:
- Open an issue
- Start a discussion
- Reach out on Twitter
Happy coding! 🚀
Built with ❤️ by Rayyan Quantum AI Labs