UNPKG

9.54 kBMarkdownView Raw
1# Onsen UI - Cross-platform HTML5 Mobile App Framework
2
3Onsen UI is a library of UI components to help you create beautiful hybrid and mobile web apps for both Android and iOS using Javascript.
4
5[![Join us on Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/OnsenUI/OnsenUI)
6[![Forum](https://img.shields.io/badge/forum-onsen--ui-FF412D.svg )](https://community.onsen.io/)
7[![TypeScript definitions on DefinitelyTyped](http://definitelytyped.org/badges/standard.svg)](https://github.com/OnsenUI/OnsenUI/blob/master/core/src/onsenui.d.ts)
8[![Circle CI](https://circleci.com/gh/OnsenUI/OnsenUI.svg?style=shield)](https://circleci.com/gh/OnsenUI/OnsenUI)
9[![Coverage Status](https://coveralls.io/repos/OnsenUI/OnsenUI/badge.svg?branch=master&service=github)](https://coveralls.io/github/OnsenUI/OnsenUI?branch=master)
10[![npm version](https://badge.fury.io/js/onsenui.svg)](https://badge.fury.io/js/onsenui)
11
12![Onsen UI Todo App](https://cloud.githubusercontent.com/assets/6549462/17845137/8224b696-687a-11e6-8f7b-95b7e8f20f2d.gif)
13
14The core library is written in pure Javascript and is framework agnostic which means you can use it with your favorite frameworks such as:
15
16* [React](https://onsen.io/react)
17* [Angular2](https://onsen.io/angular2)
18* [AngularJS 1.x](https://onsen.io/v2/docs/guide/angular1/index.html)
19* [Vue.js (WIP)](https://github.com/OnsenUI/OnsenUI/tree/master/bindings/vue)
20
21Onsen UI provides styles for both iOS flat design and Android's Material Design. The components will be automatically styled based on the platform which makes it possible to support both iOS and Android with the same source code.
22
23## Getting started
24
25We have several resources to help you get started creating hybrid apps with Onsen UI:
26
27* [The official docs](https://onsen.io/v2/docs/js.html) provide [reference for the core library](https://onsen.io/v2/docs/js.html) as well as the [React](https://onsen.io/v2/docs/guide/react/index.html), [Angular2](https://onsen.io/v2/docs/guide/angular2/) and [AngularJS 1.x](https://onsen.io/v2/docs/guide/angular1/) components.
28* We have an [interactive Onsen UI tutorial](https://onsen.io/tutorial/) where you can learn how to use the library and play around with the components.
29* There are lots of great tutorials and guides published in our [official Onsen UI blog](https://onsen.io/blog/categories/tutorial.html) and we are adding new content regularly.
30
31## Support
32
33If you are having trouble using some component the best place to get help is the [Onsen UI Forum](https://community.onsen.io/). We are also available to answer short questions on Twitter at [@Onsen_UI](https://twitter.com/Onsen_UI).
34
35## Examples with source code
36
37There are lots of sample applications written using Onsen UI. Here are some examples to give you an idea of what kind of apps you can create:
38
39### [Real time React Chat App with OnsenUI and Horizon!](http://tutorials.pluralsight.com/html-css/real-time-chat-app-with-onsenui-and-horizon)
40
41![Real time chat app](https://cloud.githubusercontent.com/assets/6549462/17846103/8acd4b8a-6881-11e6-86b8-1337183e3d09.png)
42
43[Download source code](https://github.com/philolo1/Horizon-Chat-MobX-OnsenUI)
44
45### [Weather application using React, Redux and Webpack](https://onsen.io/blog/cordova-hybrid-app-with-react-redux-webpack/)
46
47![Weather application](https://cloud.githubusercontent.com/assets/6549462/17846106/8b0ceb96-6881-11e6-8da0-14ff78047647.png)
48
49[Download source code](https://onsen.io/blog/cordova-hybrid-app-with-react-redux-webpack/)
50
51### [Todo application in pure Javascript](https://onsen.io/blog/auto-style-app-onsen/)
52
53![Todo application](https://cloud.githubusercontent.com/assets/6549462/17846105/8aedd1fc-6881-11e6-9c26-44289b0451f9.png)
54
55[Download source code](https://github.com/frankdiox/OnsenUI-Todo-App)
56
57## What is Onsen UI?
58
59* **Open source**, free and open for all. It's designed and implemented to deliver unprecedented user interface and user experience for your mobile and hybrid apps. Onsen UI is built on top of Web Components so applications can be built using **HTML tags** web developers already know and love.
60
61* **Framework agnostic**. This means that it can be used with whatever front-end framework you prefer. However, it also provides a binding library for [**Angular 1 & 2**](https://angularjs.org/) which makes it easy to integrate our custom tags with these frameworks. [**React Components** for Onsen UI](https://onsen.io/react) are also available and they play really well with React tooling such as [React Hot Loader](https://github.com/gaearon/react-hot-loader), [Redux](https://github.com/reactjs/redux) or [MobX](https://github.com/mobxjs/mobx).
62
63* Completely integrated with Monaca kit, a complete set of tools that makes PhoneGap/Cordova development super simple. **Monaca CLI** provides **Onsen UI templates, device debugger, remote building** and any service you might need directly from your terminal. We also have [GUI and cloud alternatives](https://monaca.io/) if you prefer that over CLI.
64
65* Beautifully made with **flat (iOS) and Material Design (Android)** flavors. It automatically styles your app depending on the platform and gives you control to customize it. Check out our [*Automatic Styling*](https://onsen.io/blog/auto-style-app-onsen/) in action. It also includes [Onsen CSS Components](http://components2.onsen.io/), a free resource of UI templates with "**theme roller**" functionality. Developers can pick and choose, grab the code they need, and they're off and running. And they can create their own templates and submit to Onsen UI to be included with other templates available.
66
67* [**Fully documented**](https://onsen.io/v2/docs/js.html). And if you want even more, we provide an [**Interactive Tutorial**](http://tutorial.onsen.io) where you can try and modify examples, export your code online and even generate Cordova projects.
68
69* Community based. Check out our [**blog**](https://onsen.io/blog/), [**forum**](https://community.onsen.io/) and [**chat**](https://gitter.im/OnsenUI/OnsenUI) to get the latest updates and directly contact the dev team. We are always very active answering questions so you don't get stuck with your apps.
70
71## Browser Support
72
73Onsen UI is tested with the following browsers and mobile OS.
74
75 * Android 4.4+ (and Android 4.0+ with Crosswalk engine)
76 * iOS8+
77 * Windows Phone 10+
78 * Google Chrome
79 * Safari
80
81## What's Included
82
83* [Material Design](http://www.google.co.jp/design/spec/material-design/introduction.html): For Native-like Android UI
84* [Web Components](http://webcomponents.org/): for Custom Elements
85* [AngularJS module](https://angularjs.org/): bindings are backwards compatible with Onsen UI 1
86* [Angular 2 components](https://angular.io/): components for Angular 2
87* [React components](https://facebook.github.io/react/): components for React
88
89## Getting Started Using Templates
90
91See the [Onsen UI Getting Started](http://onsen.io/getting_started/) page. We provide project templates for you in the [`project-templates`](https://github.com/OnsenUI/project-templates) repository. You will see the instruction on how to run the project there.
92For Visual Studio developers we provide directly provide [Onsen UI extension](https://taco.visualstudio.com/en-us/docs/tutorial-onsen).
93
94## Getting Started Using Monaca
95
96[Monaca](https://monaca.io/) is a set of tools that makes hybrid mobile app development with PhoneGap/Cordova simple and easy: debugging suite, push notifications, remote build, back-end, encryption, version control and more. See the [Onsen UI Getting Started Page](http://onsen.io/getting_started/) for more information.
97
98```
99$ [sudo] npm -g install monaca
100$ monaca create helloworld # And choose the starter template
101$ cd helloworld # Switch to the directory
102$ monaca preview # Preview on the browser
103$ monaca debug # Preview on the real device
104```
105
106## Download Onsen UI
107
108Onsen UI is available with npm, bower or jspm. Example:
109
110```bash
111npm install onsenui
112```
113
114For React:
115
116```bash
117npm install react-onsenui
118```
119
120For Angular2:
121
122```bash
123$ npm install angular2-onsenui
124```
125
126## How to manually build this project
127
128Clone this repository and run the following commands to build the project:
129
130```bash
131$ yarn
132$ gulp build
133```
134
135This command requires you to [install yarn](https://yarnpkg.com/en/docs/install) if you haven't already. The files will be built and copied into **build** folder.
136
137## Running Examples
138
139```bash
140$ gulp serve
141```
142
143* Then navigate your browser to [http://0.0.0.0:3000/examples/index.html](http://0.0.0.0:3000/examples/index.html)
144
145## Running the test suite
146
147Onsen UI has unit tests for the Web Components as well as end-to-end testing of the AngularJS directives using Protractor.
148
149Use the following commands to run the unit tests:
150
151```bash
152$ gulp core-test
153```
154
155or these commands for the protractor tests:
156
157```bash
158$ gulp e2e-test
159```
160
161It will take some time the because it will download a stand-alone Selenium Server and a Chrome webdriver the first time it's executed.
162
163To run a single test or a group of tests use the `--specs` parameter and provide a comma-separated list of spec files:
164
165```bash
166$ gulp e2e-test --specs test/e2e/lazyRepeat/scenarios.js
167```
168
169In order to run both the unit tests and the end-to-end tests use the following command:
170
171```bash
172$ gulp test
173```
174
175## How to contribute
176
177Please see our [document on contributing](https://github.com/OnsenUI/OnsenUI/blob/master/CONTRIBUTING.md). See the full list of contributors [here](https://github.com/OnsenUI/OnsenUI/blob/master/CONTRIBUTORS.md).