Onsen UI - Cross-platform HTML5 Mobile App Framework
Onsen 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.
We have several resources to help you get started creating hybrid apps with Onsen UI:
- The official docs provide reference for the core library as well as the React, Angular2 and AngularJS 1.x components.
- We have an interactive Onsen UI tutorial where you can learn how to use the library and play around with the components.
- There are lots of great tutorials and guides published in our official Onsen UI blog and we are adding new content regularly.
Examples with source code
There 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:
What is Onsen UI?
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.
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 which makes it easy to integrate our custom tags with these frameworks. React Components for Onsen UI are also available and they play really well with React tooling such as React Hot Loader, Redux or MobX.
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 if you prefer that over CLI.
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 in action. It also includes Onsen CSS Components, 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.
Onsen UI is tested with the following browsers and mobile OS.
- Android 4.4+ (and Android 4.0+ with Crosswalk engine)
- Windows Phone 10+
- Google Chrome
- Material Design: For Native-like Android UI
- Web Components: for Custom Elements
- AngularJS module: bindings are backwards compatible with Onsen UI 1
- Angular 2 components: components for Angular 2
- React components: components for React
Getting Started Using Templates
See the Onsen UI Getting Started page. We provide project templates for you in the
project-templates repository. You will see the instruction on how to run the project there. For Visual Studio developers we provide directly provide Onsen UI extension.
Getting Started Using Monaca
Monaca 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 for more information.
$ [sudo] npm -g install monaca $ monaca create helloworld # And choose the starter template $ cd helloworld # Switch to the directory $ monaca preview # Preview on the browser $ monaca debug # Preview on the real device
Download Onsen UI
Onsen UI is available with npm, bower or jspm. Example:
npm install onsenui
npm install react-onsenui
$ npm install angular2-onsenui
How to manually build this project
Clone this repository and run the following commands to build the project:
$ yarn $ gulp build
This command requires you to install yarn if you haven't already. The files will be built and copied into build folder.
$ gulp serve
- Then navigate your browser to http://0.0.0.0:3000/examples/index.html
Running the test suite
Onsen UI has unit tests for the Web Components as well as end-to-end testing of the AngularJS directives using Protractor.
Use the following commands to run the unit tests:
$ gulp core-test
or these commands for the protractor tests:
$ gulp e2e-test
It will take some time the because it will download a stand-alone Selenium Server and a Chrome webdriver the first time it's executed.
To run a single test or a group of tests use the
--specs parameter and provide a comma-separated list of spec files:
$ gulp e2e-test --specs test/e2e/lazyRepeat/scenarios.js
In order to run both the unit tests and the end-to-end tests use the following command:
$ gulp test