Thank you for contributing to the ODE Component Library! This guide will help you add, modify, or update components.
packages/components/
├── src/
│ ├── shared/ # Platform-agnostic types and utilities
│ ├── react-web/ # React Web implementations
│ └── react-native/ # React Native implementations
├── package.json
└── README.md
-
Define Types (in
src/shared/types.ts):export interface MyComponentProps { children: React.ReactNode; // ... other props }
-
Create React Web Implementation (
src/react-web/MyComponent.tsx):- Use CSS for styling
- Import tokens from
@ode/tokens/dist/json/tokens.json - Follow the existing component patterns
-
Create React Native Implementation (
src/react-native/MyComponent.tsx):- Use StyleSheet for styling
- Import tokens from
@ode/tokens/dist/react-native/tokens - Match the API of the web version
-
Export from platform-specific index files:
src/react-web/index.tssrc/react-native/index.ts
All components must follow:
- Minimalism - Clean, uncluttered design
- Consistency - Use ODE tokens for all values
- Accessibility - WCAG compliant, proper ARIA attributes
- Responsiveness - Works on all screen sizes
- Performance - Lightweight and optimized
The Button component has unique requirements:
- Fading Border: Border fades on one end (left button fades right, right button fades left)
- Hover States: Background fills on hover, text changes to contrast color
- Paired Buttons: When two buttons are together, they have opposite styles
- Smooth Transitions: All state changes use smooth animations
- Test on both platforms (web and native)
- Verify accessibility with screen readers
- Test with different screen sizes
- Ensure dark mode support
Follow conventional commits:
feat(components): add new Card componentfix(components): fix Button hover statedocs(components): update README