Contribution Guide
How to contribute to the LOKE Design System — standards, workflow, and release process.
Contribution Guide
This guide outlines the process and standards for contributing to the LOKE Design System. Whether you're fixing a bug, improving documentation, or adding a new component, this guide will help you understand how to contribute effectively.
The LOKE Design System is maintained internally for LOKE products. All LOKE team members are encouraged to contribute improvements that benefit our product ecosystem.
Overview
The LOKE Design System is built and maintained specifically for LOKE applications. Contributions from LOKE team members help ensure the system evolves with our product needs and maintains consistency across our ecosystem.
Getting Started
Repository Setup
-
Clone the repository:
git clone https://github.com/LOKE/design-system-beta cd design-system-beta -
Install dependencies:
bun install -
Start the development environment:
bun dev
This will launch the documentation site where you can explore components, test your changes, and see live documentation updates.
Development Workflow
Branch Strategy
main: The production branch containing the latest stable releasefeature/*: Feature branches for new components or significant changesfix/*: Branches for bug fixes
Always create a new branch from main when starting work on a new feature or fix:
git checkout main
git pull
git checkout -b feature/your-feature-nameCreating Changesets
We use changesets to manage versioning and changelogs.
Before submitting a PR, create a changeset that describes your changes:
bun changesetFollow the prompts to:
- Select the package(s) you've modified
- Choose the appropriate semver increment (patch, minor, major)
- Write a description of your changes
This will create a markdown file in the .changeset directory that will be used to generate the changelog when the changes are released.
Code Standards
The repository includes Biome and TypeScript configurations that enforce code standards. Run the linter before submitting your PR:
bun lintTo check TypeScript types:
bun check-typesComponent Development Guidelines
When creating or modifying components for LOKE products:
- Modular Structure: Each component should be in its own directory
- TypeScript: All components must be written in TypeScript for type safety
- Documentation: Create comprehensive MDX documentation pages
- Accessibility: Ensure all components meet WCAG 2.1 AA standards
- Testing: Include relevant tests for your component
- Performance: Optimize for real-world LOKE product usage patterns
- Brand Consistency: Follow LOKE design principles and visual identity
Folder Structure
Components should follow this folder structure:
packages/design-system/src/components/your-component/
├── index.ts # Exports from the component
├── YourComponent.tsx # Main component implementation
└── YourComponent.test.tsx # Component tests (if applicable)Documentation should be added to the docs site:
apps/docs/src/content/docs/components/
└── your-component.mdx # Component documentation pagePull Request Process
- Create a PR: Push your branch and create a pull request against
main - CI Checks: Ensure all CI checks pass (linting, type checking, tests)
- Code Review: Request review from team members
- Feedback: Address any feedback from reviewers
- Approval: Once approved, your PR will be merged by a maintainer
Release Process
Releases are managed by the design system maintainers. The process generally follows these steps:
- Changesets are collected from merged PRs
- Maintainers run the release workflow which:
- Updates versions based on changesets
- Generates changelogs
- Publishes to the package registry
Adding New Components
When adding a new component:
- Research: Ensure the component is needed and not duplicating existing functionality
- Design Review: Get design approval for the component
- Implementation: Develop the component following our guidelines
- Documentation: Create comprehensive documentation and stories
- Testing: Thoroughly test the component, including accessibility tests
- Example Usage: Include example usage in your PR description
Component Documentation Template
Documentation for each component should include:
- Component purpose and use cases
- Props API documentation
- Examples of basic and advanced usage
- Accessibility considerations
- Any known limitations or caveats
Updating Existing Components
When updating existing components:
- Backward Compatibility: Consider the impact on existing usage
- Semver: Follow semantic versioning guidelines
- Patch: Bug fixes and minor changes that don't affect the API
- Minor: New features that don't break existing functionality
- Major: Breaking changes to the component API
- Migration Guide: For breaking changes, provide a migration guide
Icons
To add new icons to the system:
- Place the SVG file in the
src/icons/svg/{source}directory - Run the icon generation script:
bun build:icons - This will generate the React component and update exports
Follow these guidelines for icon SVGs:
- Use a 24×24 viewBox
- Use simple paths with minimal points
- Use a consistent stroke width (typically 2px)
- Remove unnecessary metadata
Styling Guidelines
- Use the built-in theme variables for colors
- Follow the spacing scale for margins and padding
- Use the Tailwind class naming convention
Testing
Components should be tested for:
- Functionality — Core behaviors work as expected
- Accessibility — WCAG 2.1 AA compliance
- Responsive behavior — Works across LOKE product viewport sizes
- Cross-browser compatibility — Tested in browsers used by LOKE customers
- Type safety — TypeScript types are accurate and helpful
To run type checks:
bun check-typesTo run linting:
bun lintAlways test your components in a real LOKE product environment when possible to ensure they work as expected in production.
Documentation Best Practices
- Use clear, concise language
- Include examples for different use cases
- Document all props with types and descriptions
- Explain any non-obvious behaviors
- Provide accessibility information
Troubleshooting
Common Issues
-
Development server not starting: Try clearing caches and reinstalling dependencies
rm -rf node_modules .next bun install bun dev -
Type errors: Ensure all packages are built and dependencies are up to date
bun run build bun check-types -
Build errors: Make sure all dependencies are properly installed
bun install
Getting Help
If you need help contributing to the LOKE Design System:
- Documentation — Check existing documentation and component examples
- Team — Reach out to other LOKE engineers on Slack
- Codebase — Look for similar components or patterns in the repository
- Design Team — Consult with LOKE designers for visual and UX guidance
Questions about design decisions or component usage? The LOKE design team is here to help ensure consistency across our products.
Conclusion
Thank you for contributing to the LOKE Design System! Your efforts help improve the quality and consistency of all LOKE products.
Remember:
- This system serves LOKE products — design decisions should align with LOKE's product needs
- Quality over speed — take time to ensure accessibility, performance, and maintainability
- Documentation matters — good docs help other LOKE developers use components correctly
- Ask questions — the team is here to help you contribute effectively
The design system is a living project that evolves with LOKE's needs. Your contributions shape the future of our product ecosystem.