Convert Figma logo to code with AI

microsoft logoreact-native-windows

A framework for building native Windows apps with React.

16,237
1,134
16,237
746

Top Related Projects

A framework for building native applications using React

32,626

An open-source framework for making universal native apps with React. Expo runs on Android, iOS, and the web.

A powerful cross-platform UI toolkit for building native-quality iOS, Android, and Progressive Web Apps with HTML, CSS, and JavaScript.

164,677

Flutter makes it easy and fast to build beautiful apps for mobile and beyond

⚡ Empowering JavaScript with native platform APIs. ✨ Best of all worlds (TypeScript, Swift, Objective C, Kotlin, Java, Dart). Use what you love ❤️ Angular, Capacitor, Ionic, React, Solid, Svelte, Vue with: iOS (UIKit, SwiftUI), Android (View, Jetpack Compose), Dart (Flutter) and you name it compatible.

113,668

:electron: Build cross-platform desktop apps with JavaScript, HTML, and CSS

Quick Overview

React Native for Windows is an open-source project that allows developers to build native Windows applications using React Native. It extends the React Native framework to support the Windows platform, enabling the creation of cross-platform apps that run on Windows 10, Windows 11, and Xbox.

Pros

  • Enables cross-platform development for Windows using React Native
  • Leverages native Windows UI components for better performance and user experience
  • Supports a large portion of the React Native API and third-party modules
  • Allows code sharing between mobile and desktop applications

Cons

  • Learning curve for developers new to Windows development
  • Some React Native modules may not be fully compatible with Windows
  • Performance may not match fully native Windows applications in all scenarios
  • Limited support for older Windows versions (pre-Windows 10)

Code Examples

  1. Creating a basic Windows app component:
import React from 'react';
import { View, Text } from 'react-native';

const App = () => {
  return (
    <View>
      <Text>Hello, Windows!</Text>
    </View>
  );
};

export default App;
  1. Using Windows-specific APIs:
import React from 'react';
import { View, Button } from 'react-native';
import { useColorScheme } from 'react-native-windows';

const App = () => {
  const colorScheme = useColorScheme();

  return (
    <View style={{ backgroundColor: colorScheme === 'dark' ? 'black' : 'white' }}>
      <Button title="Click me" color={colorScheme === 'dark' ? 'white' : 'black'} />
    </View>
  );
};

export default App;
  1. Accessing Windows-specific modules:
import React from 'react';
import { View, Text } from 'react-native';
import { WebView } from 'react-native-windows-webview';

const App = () => {
  return (
    <View style={{ flex: 1 }}>
      <Text>Windows WebView Example</Text>
      <WebView source={{ uri: 'https://reactnative.dev/' }} style={{ flex: 1 }} />
    </View>
  );
};

export default App;

Getting Started

To start developing with React Native for Windows:

  1. Install dependencies:
npm install -g react-native-cli
npm install -g rnpm-plugin-windows
  1. Create a new React Native project:
react-native init MyWindowsApp
cd MyWindowsApp
  1. Add Windows support to your project:
react-native windows
  1. Run your Windows app:
react-native run-windows

This will set up a basic React Native project with Windows support and launch it in development mode.

Competitor Comparisons

A framework for building native applications using React

Pros of React Native

  • Larger community and ecosystem, with more third-party libraries and resources
  • Better support for iOS and Android platforms
  • More mature and stable, with a longer development history

Cons of React Native

  • Limited support for Windows and macOS desktop platforms
  • Less integration with native Windows APIs and features
  • May require additional work to achieve a native Windows look and feel

Code Comparison

React Native (for mobile):

import { Platform, StyleSheet } from 'react-native';

const styles = StyleSheet.create({
  container: {
    ...Platform.select({
      ios: { shadowColor: 'black' },
      android: { elevation: 4 },
    }),
  },
});

React Native Windows:

import { Platform, StyleSheet } from 'react-native';

const styles = StyleSheet.create({
  container: {
    ...Platform.select({
      windows: { borderColor: 'gray', borderWidth: 1 },
    }),
  },
});

The code snippets demonstrate platform-specific styling. React Native focuses on iOS and Android, while React Native Windows adds Windows-specific styles.

32,626

An open-source framework for making universal native apps with React. Expo runs on Android, iOS, and the web.

Pros of Expo

  • Easier setup and development process, especially for beginners
  • Supports a wider range of platforms (iOS, Android, and web)
  • Extensive library of pre-built components and APIs

Cons of Expo

  • Less flexibility and customization options for native modules
  • Larger app size due to included libraries and dependencies
  • Limited access to certain device-specific features

Code Comparison

Expo:

import React from 'react';
import { View, Text } from 'react-native';
import { Camera } from 'expo-camera';

export default function App() {
  return (
    <View>
      <Camera style={{ flex: 1 }} />
      <Text>Expo Camera Example</Text>
    </View>
  );
}

React Native Windows:

import React from 'react';
import { View, Text } from 'react-native';
import { RNCamera } from 'react-native-camera';

export default function App() {
  return (
    <View>
      <RNCamera style={{ flex: 1 }} />
      <Text>React Native Windows Camera Example</Text>
    </View>
  );
}

The code comparison shows that while both frameworks allow for camera integration, Expo uses its own expo-camera module, which is easier to set up but may have limitations. React Native Windows uses the react-native-camera module, which requires more setup but offers more customization options for Windows-specific features.

A powerful cross-platform UI toolkit for building native-quality iOS, Android, and Progressive Web Apps with HTML, CSS, and JavaScript.

Pros of Ionic Framework

  • Cross-platform development for web, iOS, Android, and desktop
  • Large ecosystem with pre-built UI components and plugins
  • Uses web technologies (HTML, CSS, JavaScript) for easier adoption

Cons of Ionic Framework

  • Performance may be slower than native solutions
  • Limited access to native device features compared to React Native
  • Steeper learning curve for developers new to web technologies

Code Comparison

Ionic Framework:

import { Component } from '@angular/core';

@Component({
  selector: 'app-home',
  template: '<ion-content>Hello World</ion-content>'
})
export class HomePage {}

React Native Windows:

import React from 'react';
import { View, Text } from 'react-native';

const HomePage = () => (
  <View>
    <Text>Hello World</Text>
  </View>
);

Key Differences

  • Ionic Framework uses web technologies and can target multiple platforms, including web browsers
  • React Native Windows focuses on native Windows development with better performance and access to Windows-specific APIs
  • Ionic Framework has a larger ecosystem of pre-built components, while React Native Windows offers tighter integration with Windows features
  • Development approach differs: Ionic uses web-based components, while React Native Windows uses React components with native rendering
164,677

Flutter makes it easy and fast to build beautiful apps for mobile and beyond

Pros of Flutter

  • Cross-platform development for mobile, web, and desktop from a single codebase
  • Hot reload feature for faster development and iteration
  • Rich set of pre-built widgets for Material Design and Cupertino (iOS-style) interfaces

Cons of Flutter

  • Larger app size compared to native applications
  • Less mature ecosystem and community support for Windows development
  • Steeper learning curve for developers new to Dart programming language

Code Comparison

Flutter:

import 'package:flutter/material.dart';

void main() {
  runApp(MaterialApp(
    home: Scaffold(
      appBar: AppBar(title: Text('Hello World')),
      body: Center(child: Text('Welcome to Flutter!')),
    ),
  ));
}

React Native Windows:

import React from 'react';
import { View, Text, AppRegistry } from 'react-native';

const App = () => (
  <View>
    <Text>Welcome to React Native Windows!</Text>
  </View>
);

AppRegistry.registerComponent('MyApp', () => App);

⚡ Empowering JavaScript with native platform APIs. ✨ Best of all worlds (TypeScript, Swift, Objective C, Kotlin, Java, Dart). Use what you love ❤️ Angular, Capacitor, Ionic, React, Solid, Svelte, Vue with: iOS (UIKit, SwiftUI), Android (View, Jetpack Compose), Dart (Flutter) and you name it compatible.

Pros of NativeScript

  • Supports multiple JavaScript frameworks (Angular, Vue.js, and plain JavaScript)
  • Provides access to native APIs without plugins or wrappers
  • Allows sharing code between web and mobile applications

Cons of NativeScript

  • Smaller community and ecosystem compared to React Native
  • Steeper learning curve for developers new to mobile development
  • Limited third-party UI component libraries

Code Comparison

NativeScript (XML and JavaScript):

<Page>
  <StackLayout>
    <Label text="Hello, NativeScript!" />
    <Button text="Click Me" tap="{{ onTap }}" />
  </StackLayout>
</Page>
exports.onTap = function() {
  console.log("Button tapped!");
};

React Native Windows (JSX):

import React from 'react';
import { View, Text, Button } from 'react-native';

export default function App() {
  return (
    <View>
      <Text>Hello, React Native Windows!</Text>
      <Button title="Click Me" onPress={() => console.log("Button pressed!")} />
    </View>
  );
}

Both frameworks aim to provide cross-platform development solutions, but React Native Windows focuses specifically on Windows integration, while NativeScript offers a broader range of platform support. React Native Windows benefits from the larger React ecosystem, while NativeScript provides more direct access to native APIs.

113,668

:electron: Build cross-platform desktop apps with JavaScript, HTML, and CSS

Pros of Electron

  • Cross-platform development for desktop applications (Windows, macOS, Linux)
  • Large ecosystem and community support
  • Easier learning curve for web developers

Cons of Electron

  • Larger application size and higher memory usage
  • Performance can be slower compared to native applications
  • Security concerns due to Chromium's attack surface

Code Comparison

React Native Windows:

import React from 'react';
import { View, Text } from 'react-native';

const App = () => (
  <View>
    <Text>Hello, Windows!</Text>
  </View>
);

Electron:

const { app, BrowserWindow } = require('electron');

function createWindow() {
  const win = new BrowserWindow({ width: 800, height: 600 });
  win.loadFile('index.html');
}

app.whenReady().then(createWindow);

React Native Windows focuses on creating native Windows applications using React Native, while Electron enables cross-platform desktop app development using web technologies. React Native Windows offers better performance and smaller app sizes for Windows-specific applications, but has a steeper learning curve for developers unfamiliar with React Native. Electron provides easier development for web developers and cross-platform support but at the cost of larger app sizes and potentially lower performance.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Hero Image with Logo

React Native for Windows

Follow @windowsui

Website · Documentation · Release notes

See the official React Native website for an introduction to React Native.

React Native is a framework developed by Meta that enables you to build world-class application experiences on native platforms using a consistent developer experience based on JavaScript and React. The focus of React Native is on developer efficiency across all the platforms you care about - learn once, write anywhere.

This repository adds support for the Windows 10 SDK, which allows you to build apps for all devices supported by Windows 10 including PCs, tablets, 2-in-1s, Xbox, Mixed reality devices etc.

Visit the official React Native for Windows + macOS website to learn more.

🛣️ Roadmap

Check out our blog if you'd like to stay up to date on the status of React Native for Windows and check out current and past roadmaps.

New Architecture

Fabric is the new rendering system for React Native, designed to share more rendering logic cross-platform. RNW's existing Paper renderer is built on UWP XAML, dropping down into native Composition as need be; the new RNW Fabric renderer targets Composition from the start but has the ability to host islands of XAML for advanced native controls. Apps on the new architecture will be WinAppSDK Win32 by default. For more details on our roadmap to Fabric, check out this pinned issue.

🖼️ React Native Gallery

Make sure to also check out the React Native Gallery, our interactive sample experience showing everything you can do with React Native for Windows.

WinUI 3 Gallery


📋 Getting Started

See the Getting Started Guide on our React Native for Windows + macOS website to build your first React Native for Windows app.

Requirements

You can run React Native Windows apps only on devices supported by the Windows 10 SDK.

For a full and detailed list of the system requirements and how to set up your development platform, see our System Requirements documentation on our website.

Logging Issues

Search the existing issues and try to make sure your problem doesn’t already exist before opening a new issue. If your issue doesn't exist yet, provide as much information as possible so we can better help you. Include the information requested by the appropriate issue template.

Documentation

React Native has great documentation. React Native for Windows adds its own separate Windows and macOS documentation for desktop platform information like API docs and blog updates.

Examples

  • Using the CLI in the Getting Started guide will set you up with a sample React Native for Windows app that you can begin editing right away.
  • Check the samples repo for more standalone samples.
  • The React Native Gallery app demonstrates various components in an interactive way.
  • Check out the React Native Developer Blog to see examples from past conference talks, blog posts, and more.
  • For more sample code browse the RNTester folder in the GitHub web UI.

📢 Contributing

See Contributing guidelines for how to setup your fork of the repo and start a PR to contribute to React Native for Windows.

Not sure where to start? The good first issue and help wanted labels are the best starting points.

Code of Conduct

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

NPM DownloadsLast 30 Days