# React Native for Web [![Build Status][travis-image]][travis-url] [![npm version][npm-image]][npm-url] [React Native][react-native-url] components and APIs for the Web. ~17.7 KB minified and gzipped. * [Slack: #react-native-web on reactiflux][slack-url] * [Gitter: react-native-web][gitter-url] ## Table of contents * [Install](#install) * [Example](#example) * [APIs](#apis) * [Components](#components) * [Styling](#styling) * [Accessibility](#accessibility) * [Contributing](#contributing) * [Thanks](#thanks) * [License](#license) ## Install ``` npm install --save react react-dom react-native-web ``` ## Example React Native for Web exports its components and a reference to the `React` installation. Styles are defined with, and used as JavaScript objects. Component: ```js import React, { Image, StyleSheet, Text, View } from 'react-native-web' const Title = ({ children }) => {children} const Summary = ({ children }) => ( {children} ) class App extends React.Component { render() { return ( React Native Web Build high quality web apps using React ) }, }) const styles = StyleSheet.create({ row: { flexDirection: 'row', margin: 40 }, image: { height: 40, marginRight: 10, width: 40, }, text: { flex: 1, justifyContent: 'center' }, title: { fontSize: '1.25rem', fontWeight: 'bold' }, subtitle: { fontSize: '1rem' } }) ``` Pre-render styles on the server: ```js // server.js import App from './components/App' import React, { StyleSheet } from 'react-native-web' const html = React.renderToString(); const css = StyleSheet.renderToString(); const Html = () => (