GithubHelp home page GithubHelp logo

alexxnica / react-native-web Goto Github PK

View Code? Open in Web Editor NEW

This project forked from necolas/react-native-web

0.0 0.0 0.0 8.08 MB

React Native for Web

Home Page: https://necolas.github.io/react-native-web/storybook

License: Other

JavaScript 99.82% HTML 0.05% CSS 0.13%

react-native-web's Introduction

React Native for Web

Build Status npm version

"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.

{
  "plugins": [
    "react-native-web/babel"
  ],
  "presets": [
    "react-native"
  ]
}

(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:

Example code

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') })

Starter kits

Related projects

License

React Native for Web is BSD licensed.

react-native-web's People

Contributors

aaroncraig10e avatar amoghbanta avatar apalm avatar bloodyowl avatar brunolemos avatar cesarandreu avatar comp615 avatar dremora avatar fabriziomoscon avatar hfter789 avatar ijzerenhein avatar jhen0409 avatar joecortopassi avatar karanjthakkar avatar kennethlynne avatar l1fescape avatar minishlink avatar monirabuhilal avatar moox avatar n3tr avatar nathanhleung avatar ndbroadbent avatar necolas avatar ntharim avatar paularmstrong avatar sophiebits avatar tanhauhau avatar vaukalak avatar vincebt avatar wyze avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.