English | 简体中文
Created by gh-md-toc
Highly customizable and theming components for React Native
Browse the docs on blankapp.org or try it out on our live demo.
- Lightly dependency, very little dependency
- Global theming, a variety of style selector implementation
- Rich base components
- Friendly API design
Before starting make sure you have:
- Installed Yarn
- Installed React Native
Create a new React Native App:
$ react-native init HelloWorld
$ cd HelloWorld
Install @blankapp/ui
to your project:
$ yarn add @blankapp/ui
Now, simply copy the following to your index.js
file of React Native project:
import React, { Component } from 'react';
import { AppRegistry } from 'react-native';
import Theme, { ThemeProvider, Screen, Text} from '@blankapp/ui';
import defaultTheme from '@blankapp/ui/src/resources/themes/default';
// Register a default theme
Theme.registerTheme('default', [
defaultTheme,
]);
class Examples extends Component {
render() {
return (
<ThemeProvider>
<Screen>
<Text>Hello World</Text>
</Screen>
</ThemeProvider>
);
}
}
AppRegistry.registerComponent('Examples', () => Examples);
P.S. If you want to start a project quickly, you can use the project template that we prepared for you react-native-template-ui-based.
- Running on Android:
$ react-native run-android
$ adb reverse tcp:8081 tcp:8081 # required to ensure the Android app can
- Running on iOS:
$ react-native run-ios
If you have any suggestions or questions about this project, you can discuss it by Telegram or my private wechat.
MIT License
Copyright (c) 2018 JianyingLi <[email protected]>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.