Thank you for your interest in contributing to Reusables! This guide will help you understand our development process and how you can contribute effectively.
- Project Structure
- Development Workflow
- Submitting Your Contribution
- Best Practices
- Need Help?
- Review Process
- License
The project is organized into several key directories:
registry/: Contains the core reusable components, hooks, and utilitiesdefault/reusables/: Main reusable componentsdefault/hooks/: Reusable React hooksdefault/lib/: Utility functionsdefault/example/: Example implementations
content/docs/: Documentation for all components and features
Before contributing:
- Familiarize yourself with existing reusables and their documentation.
- Review components like the
split-buttonto understand project patterns and standards. - Each reusable typically consists of:
- Core component(s) in the registry
- Example implementation
- Documentation
- Ensure it's reusable across different projects
- Consider common use cases and customization options
- Create your component in the appropriate directory:
- UI components:
registry/reusables/ui/ - React hooks:
registry/hooks/ - Utility functions:
registry/lib/
- UI components:
- Add necessary types and interfaces
- Implement the core functionality
- Register your component in the registry.json file
- Add proper comments and TypeScript documentation
- Add example implementation in
registry/example/ - Demonstrate different use cases and variations
- Run
bun run buildorbun run build:registry- This step is crucial before documentation
- Skipping may cause "component not found" errors
- Test your component across different scenarios
- Ensure proper error handling
- Verify accessibility standards
We use FumaDocs for documentation. Familiarize yourself with FumaDocs UI components before starting.
- Add a new MDX file in
content/docs/ - Follow the existing documentation structure
---
title: Component Name
description: Brief description of the component
---
## Overview
[Component description and use cases]
## Installation
<Tabs items={["CLI", "Manual"]}>
<Tab value="CLI">
`package-install
npx shadcn@latest add "https://reusables.vercel.app/r/component-name"
`
</Tab>
<Tab value="Manual">
`json doc-gen:file
{
"file": "registry/reusables/component-name.tsx",
"codeblock": {
"lang": "tsx",
"meta": "title=\"component-name.tsx\""
}
}
`
</Tab>
</Tabs>
## Usage
[Basic usage example]
## Examples
[Different implementation examples]
## API Reference
[Component props and methods]- Use the
<ComponentSource>component to reference and display component examples - Show different use cases
- Provide copy-pastable code snippets
-
Fork & Branch
- Fork the repository
- Create a feature branch:
feature/component-name
-
Commit Guidelines
- Write clear, concise commit messages
- Keep commits focused and atomic
-
Pull Request
- Submit a PR with a clear description
- Reference any related issues
- Ensure all checks pass
-
Component Design
- Keep components focused and single-purpose
- Use TypeScript for type safety
- Follow React best practices
- Ensure accessibility (ARIA attributes, keyboard navigation)
-
Code Style
- Follow the project's ESLint and Prettier configurations
- Use meaningful variable and function names
- Add JSDoc comments for complex functions
-
Documentation
- Write clear, concise documentation
- Include practical examples
- Document all props and configuration options
- Explain any complex concepts or edge cases
If you need assistance or have questions:
- Check existing documentation and examples
- Look through similar components
- Open an issue for discussion
Your contribution will be reviewed for:
- Code quality and style
- Documentation completeness
- Component reusability
- Performance and accessibility
By contributing, you agree that your contributions will be licensed under the project's MIT License.
Thank you for contributing to Reusables! Your efforts help make this project better for everyone.