Skip to main content

Design System Proposal for Daggh Companion (React Native)

Why a Design System?

A design system provides a unified set of UI components, patterns, and guidelines that ensure consistency, scalability, and speed across our app. For React Native, it should:

  • Enable rapid prototyping and iteration
  • Support theming (light/dark, brand colors)
  • Be accessible and responsive
  • Allow for easy extension and customization

Industry Standards & Best Practices

  • Atomic Design: Build components from atoms (buttons, inputs) to molecules (form fields) to organisms (cards, modals).
  • Theming: Use a theme provider (e.g., React Context) for colors, spacing, typography.
  • Type Safety: Leverage TypeScript for prop validation and IDE support.
  • Accessibility: Use accessible primitives and ARIA roles where possible.
  • Platform Awareness: Abstract platform differences (iOS/Android/web) in components.

Example: Button Component

import { Pressable, Text, StyleSheet } from "react-native"
import { useTheme } from "../theme"

type ButtonProps = {
children: React.ReactNode
onPress: () => void
variant?: "primary" | "secondary"
}

export function Button({ children, onPress, variant = "primary" }: ButtonProps) {
const { colors } = useTheme()
return (
<Pressable style={[styles.base, { backgroundColor: colors[variant] }]} onPress={onPress} accessibilityRole="button">
<Text style={styles.text}>{children}</Text>
</Pressable>
)
}

const styles = StyleSheet.create({
base: { padding: 12, borderRadius: 8, alignItems: "center" },
text: { color: "#fff", fontWeight: "bold" },
})

Existing Solutions: Comparison

SolutionFlexibilityThemingCommunityProsCons
shadcn/uiHighYesLargeModern, composable, headless, web-likeNot native, web-focused
NativeBaseMediumYesLargeMature, themeable, many componentsLess flexible, opinionated
React Native PaperMediumYesLargeMaterial Design, accessible, easyMaterial-focused, less customizable
TamaguiHighYesGrowingUniversal (web/native), fast, flexibleNewer, smaller ecosystem
RestyleHighYesMediumUtility props, theme-first, flexibleNo prebuilt components
CustomMaxYesN/AFully tailored, no bloatMore work, maintainability

Recommendation

  • Tamagui or Restyle are recommended for maximum flexibility and future web/native convergence.
  • If we want a headless, composable approach (like shadcn/ui), Tamagui is closest in spirit and supports both web and native.
  • For a more utility-driven, theme-first approach, Restyle is excellent and integrates well with custom component libraries.
  • Avoid tightly coupled, opinionated systems unless we want Material Design (then Paper is best).

Next Steps

  1. Prototype a core set of components (Button, Input, Card) using Tamagui or Restyle.
  2. Define our theme and tokens (colors, spacing, typography).
  3. Document usage and extension patterns.
  4. Evaluate developer experience and flexibility after initial implementation.

This proposal is open for discussion and iteration as we explore the best fit for our team and product needs.