Thank you for your interest in contributing to Elements UI! These components are actively used in our production projects, and we welcome contributions from the community.
-
Fork the repository
gh repo fork BitByBit-B3/elements
-
Clone your fork
git clone https://github.com/YOUR_USERNAME/elements.git cd elements -
Install dependencies
pnpm install
-
Create a branch
git checkout -b feature/my-new-feature
elements/
├── packages/
│ ├── core/ # Design tokens and theme
│ ├── react/ # React components
│ │ └── src/
│ │ ├── components/
│ │ │ └── ui/ # UI components
│ │ ├── hooks/ # React hooks
│ │ └── lib/ # Utilities
│ └── playground/ # Development playground
└── docs-site/ # VitePress documentation
# Development
pnpm dev # Start playground dev server
pnpm build # Build all packages
pnpm typecheck # Run TypeScript type checking
# Documentation
cd docs-site
pnpm dev # Start docs dev server
pnpm build # Build documentation-
Create the component file
# Create in packages/react/src/components/ui/ touch packages/react/src/components/ui/my-component.tsx -
Export the component
- Add exports to
packages/react/src/index.ts
- Add exports to
-
Add dependencies (if needed)
- Update
packages/react/package.json
- Update
-
Create documentation
- Add a page in
docs-site/components/my-component.md - Update
docs-site/components/index.md
- Add a page in
-
Update README
- Add to component list in
README.md
- Add to component list in
- Make your changes to the component file
- Update documentation if API changed
- Update version in package.json if needed
- Test in the playground
- Accessibility: Use Radix UI primitives when possible
- TypeScript: Fully type all props and exports
- Styling: Use Tailwind CSS utilities
- Variants: Use
class-variance-authorityfor variants - Composition: Support
asChildpattern where appropriate - Documentation: Include examples and API reference
- Use TypeScript
- Follow existing code patterns
- Use meaningful variable names
- Add JSDoc comments for public APIs
- Keep components focused and composable
Before submitting:
-
Type check
pnpm typecheck
-
Build successfully
pnpm build
-
Test in playground
pnpm dev
-
Commit your changes
git add . git commit -m "feat: add new component"
Commit message format:
feat:New featurefix:Bug fixdocs:Documentation changeschore:Maintenance tasksrefactor:Code refactoring
-
Push to your fork
git push origin feature/my-new-feature
-
Create a Pull Request
- Go to the original repository
- Click "New Pull Request"
- Select your branch
- Fill in the PR template
- Wait for review
- Clear description: Explain what and why
- Screenshots: Add for UI changes
- Breaking changes: Clearly mark and explain
- Tests: Ensure everything builds
- Documentation: Update docs for API changes
We have a slash command to help update components from other projects:
/update-components /path/to/source/projectThis command will:
- Scan for new components
- Update existing components
- Add dependencies
- Update documentation
- Open an Issue
- Check existing issues and PRs
- Reach out to the team
- Be respectful and inclusive
- Provide constructive feedback
- Focus on the code, not the person
- Help others learn and grow
By contributing, you agree that your contributions will be licensed under the Apache 2.0 License.
Thank you for contributing to Elements UI! 🎉