Core Principles
- •Material Design 3: Leveraging
react-native-paperfor all core components. - •Consistency: Use the
src/presentation/theme/definitions. - •Icons: Use
lucide-react-nativefor all icons.
CRITICAL RULES
1. Theming
- •ALWAYS use
useThemehook to access colors. - •NEVER hardcode colors.
typescript
const theme = useTheme();
<Text style={{ color: theme.colors.primary }}>Hello</Text>
2. Components
- •ALWAYS prefer Paper components (
Button,Card,TextInput) over raw React Native ones unless customizing heavily. - •ALWAYS place reusable UI components in
src/presentation/components/ui/.
3. Icons
- •ALWAYS use
lucide-react-native. - •Size: Default to
size={24}unless specified. - •Color: Use theme colors.
typescript
import { Box } from 'lucide-react-native';
<Box color={theme.colors.onSurface} size={24} />
4. Layout
- •Spacing: Use multiples of 4 or 8 (e.g., 4, 8, 16, 24, 32).
- •Typography: Use standard variants:
displayLarge,headlineMedium,bodyMedium,labelSmall.