Skip to content

A modern React Native monorepo with a shared design system for building consistent cross-platform mobile applications. Features React Native 0.80, TypeScript, Storybook v9 integration, and reusable UI components (Button, Avatar). Includes a playground app for component testing and miniApps for feature development, all managed with Yarn workspaces.

Notifications You must be signed in to change notification settings

lahirudilshan/react-native-apps-with-storybook-and-design-system

Repository files navigation

Project Logo

React Native Apps with Storybook and Design System

A powerful React Native monorepo starter kit featuring a comprehensive shared design system, Storybook integration, and TypeScript support. Build scalable, consistent mobile applications with reusable components, theme system, utilities, and modern development tools. Perfect for teams looking to streamline their React Native development workflow and maintain design consistency across multiple apps.


πŸš€ Tech Stack

  • React Native: 0.80.x
  • React: 19.1.x
  • TypeScript
  • Storybook: v9
  • Monorepo: Yarn Workspaces
  • Component Library: mobile-design-system

πŸ› οΈ Development Environment

Tool Version
Node.js 21+ (see .nvmrc)
Java JDK 17 (see .java-version)
Yarn 4.8.1
Android Build Tools 35.0.0
Android SDK Min: 24 / Target & Compile: 35
NDK 27.1.12297006
Kotlin 2.1.20

πŸ“ Project Structure

β”œβ”€β”€ apps/
β”‚   β”œβ”€β”€ miniApps/                  # Feature-specific RN app
β”‚   β”‚   β”œβ”€β”€ android/               # Android native code
β”‚   β”‚   β”œβ”€β”€ ios/                   # iOS native code
β”‚   β”‚   β”œβ”€β”€ src/                   # Source code
β”‚   β”‚   β”‚   └── components/        # App-specific components
β”‚   β”‚   β”‚       └── profile-card/  # Profile card component
β”‚   β”‚   β”œβ”€β”€ __tests__/             # Test files
β”‚   β”‚   β”œβ”€β”€ App.tsx                # Main app component
β”‚   β”‚   └── package.json           # App dependencies
β”‚   β”‚
β”‚   └── playground/                # Component testing app with Storybook
β”‚       β”œβ”€β”€ android/               # Android native code
β”‚       β”œβ”€β”€ ios/                   # iOS native code
β”‚       β”œβ”€β”€ __tests__/             # Test files
β”‚       β”œβ”€β”€ .rnstorybook/          # React Native Storybook config
β”‚       β”œβ”€β”€ .storybook/            # Web Storybook config
β”‚       β”œβ”€β”€ App.tsx                # Main app component
β”‚       └── package.json           # App dependencies
β”‚
β”œβ”€β”€ packages/
β”‚   └── mobile-design-system/      # Shared UI component library
β”‚       β”œβ”€β”€ src/                   # Source code
β”‚       β”‚   β”œβ”€β”€ components/        # Basic UI components
β”‚       β”‚   β”‚   β”œβ”€β”€ avatar/        # Avatar component
β”‚       β”‚   β”‚   β”œβ”€β”€ badge/         # Badge component
β”‚       β”‚   β”‚   └── button/        # Button component
β”‚       β”‚   β”œβ”€β”€ widgets/           # Complex components
β”‚       β”‚   β”‚   └── UserCard/      # User card widget
β”‚       β”‚   β”œβ”€β”€ domain/            # Domain-specific components
β”‚       β”‚   β”‚   └── ecommerce/     # E-commerce components
β”‚       β”‚   β”‚       └── ProductCard/ # Product card component
β”‚       β”‚   β”œβ”€β”€ providers/         # Context providers
β”‚       β”‚   β”‚   └── theme-provider/ # Theme management
β”‚       β”‚   β”œβ”€β”€ tokens/            # Design tokens
β”‚       β”‚   β”œβ”€β”€ utils/             # Utility functions
β”‚       β”‚   β”‚   β”œβ”€β”€ formatters/    # Data formatters
β”‚       β”‚   β”‚   └── validators/    # Validation utilities
β”‚       β”‚   └── index.ts           # Main exports
β”‚       β”œβ”€β”€ package.json           # Package dependencies
β”‚       └── tsconfig.json          # TypeScript configuration
β”‚
β”œβ”€β”€ plop-templates/                # Templates for code generation
β”œβ”€β”€ .husky/                        # Git hooks
β”œβ”€β”€ .vscode/                       # VS Code configuration
β”œβ”€β”€ package.json                   # Root dependencies
└── yarn.lock                      # Dependency lock file

🎨 Mobile Design System

Located at packages/mobile-design-system/, this package contains a comprehensive collection of reusable UI components, widgets, domain-specific components, theme system, and utilities.

🧩 Available Components

Basic Components

  • Avatar – Profile pictures with fallback support (small, medium, large sizes)
  • Badge – Status indicators, notifications, and labels
  • Button – Multiple variants (primary, secondary, outline) and sizes

Complex Widgets

  • UserCard – User information display with actions and status indicators

Domain-Specific Components

  • ProductCard – E-commerce product display with pricing, ratings, and actions

🎭 Theme System

  • ThemeProvider – Context provider for theme management
  • useTheme – Hook for accessing and toggling themes
  • Design Tokens – Spacing, colors, typography, and border radius tokens
  • Light/Dark Mode – Built-in theme switching support

πŸ›  Utilities

  • Formatters – Currency, date, and text formatting functions
  • Validators – Email, phone, password, and credit card validation

πŸ“š Storybook Integration

Comprehensive Storybook documentation with interactive examples for all components including:

  • Avatar variations and fallback states
  • Badge variants and styling options
  • Button states and interactions
  • UserCard with different user types and statuses
  • ProductCard with various product scenarios

πŸ§ͺ Playground App

Located at apps/playground/, this React Native app serves as the development and testing environment for UI components. Features React Native 0.80.1, React 19.1.0, and full Storybook v9 integration for both mobile and web platforms.


πŸ“± MiniApps

Located at apps/miniApps/, this demo application showcases real-world usage of the design system components. Uses React Native 0.80.0 and React 19.1.0 with examples like ProfileCard implementation.


πŸ“œ Available Scripts

πŸ”§ Root Scripts

# Linting & Formatting
yarn lint               # Run ESLint
yarn lint:fix           # Auto-fix ESLint issues
yarn format             # Format with Prettier

# Dependency Management
yarn deps:check         # Check dependency alignment
yarn deps:fix           # Fix dependencies via rnx-align-deps

# Storybook
yarn storybook:web          # Run Storybook for web
yarn storybook:mobile       # Run Storybook for mobile
yarn storybook:clean        # Clean cache
yarn storybook:all          # Run all Storybook scripts

# Package Ops
yarn package:watch          # Watch for design system changes
yarn package:build          # Build the design system

# MiniApps
yarn miniApps:dev           # Dev mode
yarn miniApps:start         # Start Metro
yarn miniApps:start-reset   # Metro with reset cache
yarn miniApps:clean         # Clean builds

# Playground
yarn playground:dev            # Dev mode
yarn playground:start          # Start Metro
yarn playground:start-reset    # Metro with reset cache
yarn playground:clean          # Clean builds

πŸ“¦ Design System Scripts

# Build & Dev
yarn clean
yarn build
yarn watch

# Code Quality
yarn lint
yarn format

# Dependency Alignment
yarn deps:check
yarn deps:fix

πŸ“± App-specific Scripts

# Platform-specific
yarn android
yarn ios

# Development
yarn start
yarn test

πŸš€ Getting Started

  1. Install dependencies:

    yarn install
  2. Build the design system:

    yarn package:build
  3. Run Playground App to see Storybook:

    # Start development environment
    yarn playground:dev
    
    # Or run Storybook directly
    yarn storybook:mobile
  4. Run MiniApps:

    # Start Metro and demo app
    yarn miniApps:dev

🎯 Key Features

  • Comprehensive Component Library with basic components, complex widgets, and domain-specific components
  • Advanced Theme System with light/dark mode support and customizable design tokens
  • TypeScript Support for full type safety and enhanced developer experience
  • Storybook Integration for interactive component documentation and testing
  • Utility Functions including formatters and validators for common use cases
  • Cross-Platform Compatibility ensuring seamless iOS and Android support
  • Monorepo Architecture with Yarn Workspaces for efficient development workflow

βœ… Code Quality Tools

  • ESLint – Code linting with custom rules
  • Prettier – Consistent code formatting
  • Lefthook / Husky – Git hooks for pre-commit validation
  • TypeScript – Static type checking

πŸ§ͺ Testing

  • Vitest – Unit testing framework in Playground app
  • Storybook – Component testing and visual documentation
  • React Native Testing Library – Component integration testing

πŸ“„ License

MIT


Built with ❀️ for scalable React Native development

About

A modern React Native monorepo with a shared design system for building consistent cross-platform mobile applications. Features React Native 0.80, TypeScript, Storybook v9 integration, and reusable UI components (Button, Avatar). Includes a playground app for component testing and miniApps for feature development, all managed with Yarn workspaces.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published