React Native for Web
"React Native for Web" brings the platform-agnostic Components and APIs of React Native to the Web.
Browse the interactive documentation or try it out on Glitch.
Features
- Interoperability with ReactDOM components.
- Native-like touch handling.
- Built-in integration with web accessibility APIs.
- Built-in support for LTR and RTL layouts.
- Built-in expressive and reliable subset of CSS.
- Optimized, vendor-prefixed CSS with good runtime performance.
- Server-side rendering of HTML and critical CSS.
- Browser support: Chrome, Firefox, Safari >= 7, IE 10, Edge.
Quick start
Install in your existing app using yarn
or npm
:
yarn add react react-dom react-native-web
Add the react-native-web/babel
plugin to your Babel configuration. This will
alias react-native
to react-native-web
and exclude any modules not required
by the app.
(For React/ReactDOM 15.4 – 15.6 support, install react-native-web@<0.1.0
)
See the Getting Started guide for more details.
Documentation
The interactive documentation shows all the supported APIs and Components.
Guides:
- Getting started
- Style
- Accessibility
- Direct manipulation
- Internationalization
- Advanced use
- Known issues
Example code
// Componentsconst Card = <View style=stylescard>children</View>const Title = <Text style=stylestitle>children</Text>const Photo = <Image source= uri style=stylesimage />const App = <Card> <Title>App Card</Title> <Photo uri="/some-photo.jpg" /> </Card> // Stylesconst styles = StyleSheet // App registration and renderingAppRegistryAppRegistry
Starter kits
Related projects
License
React Native for Web is BSD licensed.