React Native components and APIs for the Web.
Browser support: Chrome, Firefox, Safari >= 7, IE 10, Edge.
"React Native for Web" is a project to bring React Native's building blocks and touch handling to the Web.
Browse the UI Explorer to see React Native examples running on Web. Or try it out online with React Native for Web: Playground.
To install in your app:
npm install --save react@15.5 react-dom@15.5 react-native-web
Read the Getting Started guide.
Guides:
- Getting started
- Style
- Accessibility
- Direct manipulation
- Internationalization
- Advanced use
- Known issues
Exported modules:
- Components
ActivityIndicator
Button
Image
ProgressBar
ScrollView
Switch
Text
TextInput
TouchableHighlight
(mirrors React Native)TouchableOpacity
(mirrors React Native)TouchableWithoutFeedback
View
- APIs
Animated
(mirrors React Native)AppRegistry
AppState
AsyncStorage
Clipboard
Dimensions
I18nManager
NetInfo
PanResponder
(mirrors React Native)PixelRatio
Platform
StyleSheet
Vibration
import React from 'react'
import { AppRegistry, Image, StyleSheet, Text, View } from 'react-native'
// Components
const Card = ({ children }) => <View style={styles.card}>{children}</View>
const Title = ({ children }) => <Text style={styles.title}>{children}</Text>
const Photo = ({ uri }) => <Image source={{ uri }} style={styles.image} />
const App = () => (
<Card>
<Title>App Card</Title>
<Photo uri="/some-photo.jpg" />
</Card>
)
// Styles
const styles = StyleSheet.create({
card: {
flexGrow: 1,
justifyContent: 'center'
},
title: {
fontSize: '1.25rem',
fontWeight: 'bold'
},
image: {
height: 40,
marginVertical: 10,
width: 40
}
})
// App registration and rendering
AppRegistry.registerComponent('MyApp', () => App)
AppRegistry.runApplication('MyApp', { rootTag: document.getElementById('react-root') })
- react-primitives
- react-native-web-player
- react-native-web-starter
- react-native-web-webpack
- react-web
- reactxp
React Native for Web is BSD licensed.