How to contribute to Shadix UI
Contributing to Shadix UI
Thank you for your interest in contributing to Shadix UI! We welcome contributions from the open source community and appreciate your help in making this project better for everyone.
Ways to Contribute
There are many ways you can contribute to Shadix UI:
- 🐛 Report bugs - Help us identify and fix issues
- ✨ Suggest features - Propose new components or improvements
- 🎨 Add components - Create new animated components
- 📝 Improve documentation - Help others understand how to use Shadix UI
- 🔧 Fix issues - Submit pull requests for bug fixes
- 💬 Community support - Help other users in discussions
Getting Started
Prerequisites
Before contributing, make sure you have:
- Node.js 20 or higher
- pnpm package manager
- Git installed
- A GitHub account
Setting Up the Development Environment
-
Fork the repository on GitHub
-
Clone your fork locally:
git clone https://github.com/YOUR_USERNAME/shadix-ui.git cd shadix-ui -
Install dependencies:
pnpm install -
Build the registry:
pnpm run registry:build -
Start the development server:
pnpm dev
Development Workflow
Branch Naming
Use descriptive branch names that indicate the type of change:
feat/component-name- For new componentsfix/issue-description- For bug fixesdocs/update-description- For documentation updatesrefactor/component-name- For refactoring existing code
Commit Messages
Follow conventional commit format:
type(scope): description
feat(action-button): add hover animation variant
fix(motion-dialog): resolve z-index issue
docs(readme): update installation instructionsTypes:
feat- New featuresfix- Bug fixesdocs- Documentation changesstyle- Code style changesrefactor- Code refactoringtest- Adding or updating testschore- Maintenance tasks
Adding New Components
Component Structure
When adding a new component, follow this structure:
registry/new-york/
├── components/
│ └── your-component.tsx
└── demos/
└── your-component.demo.tsxComponent Requirements
All components must:
- Follow shadcn/ui patterns - Use the same conventions and structure
- Include TypeScript types - Full type safety and IntelliSense support
- Use Framer Motion - Add smooth animations and transitions
- Be accessible - Follow ARIA guidelines and keyboard navigation
- Include variants - Provide multiple styling options using CVA
- Have documentation - Clear usage examples and props documentation
Component Template
Here's a basic template for new components:
import * as React from 'react';
import { cva, type VariantProps } from 'class-variance-authority';
import { cn } from '@/lib/utils';
const yourComponentVariants = cva('base-styles', {
variants: {
variant: {
default: 'default-styles',
secondary: 'secondary-styles'
},
size: {
default: 'default-size',
sm: 'small-size',
lg: 'large-size'
}
},
defaultVariants: {
variant: 'default',
size: 'default'
}
});
export interface YourComponentProps
extends React.HTMLAttributes<HTMLDivElement>,
VariantProps<typeof yourComponentVariants> {
// Add custom props here
}
const YourComponent = React.forwardRef<HTMLDivElement, YourComponentProps>(
({ className, variant, size, ...props }, ref) => {
return <div className={cn(yourComponentVariants({ variant, size, className }))} ref={ref} {...props} />;
}
);
YourComponent.displayName = 'YourComponent';
export { YourComponent, yourComponentVariants };Demo Component
Create a demo component to showcase your component:
import { YourComponent } from '@/components/ui/your-component';
export function YourComponentDemo() {
return (
<div className="space-y-4">
<YourComponent variant="default" size="default">
Default variant
</YourComponent>
<YourComponent variant="secondary" size="sm">
Secondary small
</YourComponent>
</div>
);
}Registry Configuration
Add your component to registry.json:
{
"name": "your-component",
"description": "Brief description of your component",
"type": "registry:component",
"registryDependencies": ["button"], // Required shadcn/ui components
"dependencies": ["motion"], // Additional dependencies
"files": [
{
"path": "registry/new-york/components/your-component.tsx",
"type": "registry:ui"
}
]
}Code Standards
TypeScript
- Use strict TypeScript configuration
- Avoid
anytypes - use proper type definitions - Export interfaces and types for external use
- Use
React.forwardReffor components that need ref forwarding
Styling
- Use Tailwind CSS classes
- Follow the existing design system
- Use
cn()utility for conditional classes - Implement responsive design patterns
Animation
- Use Framer Motion for animations
- Keep animations smooth and performant
- Provide animation variants for customization
- Consider accessibility (respect
prefers-reduced-motion)
Accessibility
- Include proper ARIA attributes
- Ensure keyboard navigation works
- Test with screen readers
- Follow WCAG guidelines
Testing
Manual Testing
Before submitting a PR, test your component:
- Visual testing - Check all variants and sizes
- Responsive testing - Test on different screen sizes
- Accessibility testing - Use keyboard navigation and screen readers
- Animation testing - Verify smooth animations
- Integration testing - Test with existing components
Code Quality
Run these commands before submitting:
# Format code
pnpm run format
# Check for linting issues
pnpm run lint
# Run type checking
pnpm run check:ciSubmitting Changes
Pull Request Process
- Create a feature branch from
main - Make your changes following the guidelines above
- Test thoroughly - Ensure everything works as expected
- Update documentation if needed
- Submit a pull request with a clear description
Pull Request Template
When submitting a PR, include:
- Description - What changes you made and why
- Type of change - Bug fix, new feature, documentation, etc.
- Testing - How you tested your changes
- Screenshots - Visual changes should include before/after images
- Breaking changes - Any breaking changes should be clearly noted
Review Process
- All PRs require review before merging
- Address feedback promptly
- Keep PRs focused and reasonably sized
- Respond to review comments constructively
Reporting Issues
Bug Reports
When reporting bugs, include:
- Clear description of the issue
- Steps to reproduce the problem
- Expected behavior vs actual behavior
- Environment details (OS, browser, Node version)
- Screenshots or videos if applicable
Feature Requests
For feature requests, provide:
- Use case - Why this feature would be useful
- Proposed solution - How you envision it working
- Alternatives considered - Other approaches you've thought about
- Additional context - Any other relevant information
Community Guidelines
Code of Conduct
We are committed to providing a welcoming and inclusive environment. Please:
- Be respectful and constructive
- Focus on what's best for the community
- Show empathy towards other community members
- Accept constructive criticism gracefully
- Help create a positive environment for everyone
Getting Help
If you need help:
- Check existing issues and discussions
- Ask questions in GitHub Discussions
- Join our community conversations
- Be patient - maintainers are volunteers
Recognition
Contributors will be recognized in:
- GitHub contributor list
- Release notes for significant contributions
- Community highlights
- Contributor hall of fame
Thank you for contributing to Shadix UI! Your efforts help make this project better for everyone. 🎉