Thank you for your interest in contributing to our component library! We welcome contributions from developers of all skill levels.
- Fork the repository to your GitHub account
- Clone your fork locally
git clone https://github.com/your-username/unicorn-ui.git cd unicorn-ui - Install dependencies
npm install
- Start the development server
npm run dev
When creating or modifying components, please follow these guidelines:
- Use comprehensive TypeScript interfaces for all props
- Include JSDoc comments for all props and functions
- Ensure type safety throughout the component
- Follow the existing design patterns and styling
- Use Tailwind CSS for all styling
- Ensure responsive design (mobile-first approach)
- Include hover and focus states
- Add proper ARIA attributes
- Ensure keyboard navigation works
- Use semantic HTML elements
- Test with screen readers when possible
- Include comprehensive JSDoc comments
- Provide multiple usage examples
- Document all props with descriptions
- Include accessibility notes when relevant
Each component should follow this structure:
src/components/custom/your-component/
├── index.ts # Export file
├── your-component.tsx # Main component
└── your-component.stories.tsx # Storybook stories (optional)
import { cn } from "@/lib/utils";
import React from "react";
export interface YourComponentProps {
/**
* Component title
*/
title: string;
/**
* Optional description
*/
description?: string;
/**
* Additional CSS classes
*/
className?: string;
/**
* Click handler
*/
onClick?: () => void;
}
/**
* YourComponent description
*
* @example
* ```tsx
* <YourComponent
* title="Example"
* description="This is an example"
* onClick={() => console.log("clicked")}
* />
* ```
*/
export const YourComponent = React.memo<YourComponentProps>(
({ title, description, className, onClick }) => {
return (
<div className={cn("base-styles", className)} onClick={onClick}>
<h3>{title}</h3>
{description && <p>{description}</p>}
</div>
);
},
);
YourComponent.displayName = "YourComponent";
export default YourComponent;Before submitting your contribution:
-
Build the project
npm run build
-
Check TypeScript
npx tsc --noEmit
-
Run linting
npm run lint
-
Test in browser
- Verify your component works in the showcase
- Test responsive behavior
- Check accessibility features
-
Create a feature branch
git checkout -b feature/amazing-component
-
Make your changes
- Follow the component guidelines
- Add your component to the showcase page
- Update the main index.ts export file
-
Commit your changes
git add . git commit -m "feat: add amazing component with accessibility features"
-
Push to your fork
git push origin feature/amazing-component
-
Create a Pull Request
- Provide a clear description of your changes
- Include screenshots or GIFs if applicable
- Reference any related issues
feat: add new component namefix: resolve issue with componentdocs: update component documentationstyle: improve component styling
## Changes Made
- [ ] Added new component: ComponentName
- [ ] Updated existing component
- [ ] Fixed accessibility issue
- [ ] Improved documentation
## Component Features
- Feature 1
- Feature 2
- Feature 3
## Testing
- [ ] Component builds successfully
- [ ] TypeScript checks pass
- [ ] Responsive design verified
- [ ] Accessibility tested
## Screenshots
[Add screenshots or GIFs showing your component]- Automated Checks: Your PR will run automated builds and checks
- Manual Review: Maintainers will review your code and provide feedback
- Testing: We'll test your component across different devices and browsers
- Merge: Once approved, your contribution will be merged!
When reporting bugs, please include:
- Component name and version
- Steps to reproduce the issue
- Expected behavior
- Actual behavior
- Screenshots (if applicable)
- Browser/device information
For new component ideas:
- Check existing issues to avoid duplicates
- Describe the component and its use cases
- Provide examples or mockups if possible
- Explain the benefits it would bring to the library
- GitHub Issues: For bugs and feature requests
- GitHub Discussions: For questions and general discussion
- Documentation: Check the README and component documentation
Contributors will be:
- Listed in the README
- Credited in release notes
- Invited to be maintainers (for regular contributors)
Thank you for helping make this component library better! 🎉