ラベル

2017年1月25日水曜日

[React Native] いろいろなButtonライブラリを試してみる

公式のButtonコンポーネントが残念だったので、いろいろなライブラリを試してみようと思います。

react-native-button


ide/react-native-button
https://github.com/ide/react-native-button

さっそく

npm install react-native-button --save

READMEを参考にコードを書くとこんな感じ

enter image description here

Container Styleはシンプルで使えそう!

コードはこんな感じ

<Button
  style={{fontSize: 20, color: 'gray'}}
  styleDisabled={{color: 'black'}}
  onPress={() => this._handlePress()}>
  Usage
</Button>

<Button
  containerStyle={{padding:10, height:45, overflow:'hidden', borderRadius:4, backgroundColor: '#99AAFF'}}
  style={{fontSize: 20, color: 'gray'}}>
  Container Style
</Button>

APSL/react-native-button


APSL/react-native-button
https://github.com/APSL/react-native-button

enter image description here

このライブラリはオプションがたくさんあって幅は広そう
個人的にisLoadingが良かったです。

enter image description here

ここら辺でボタンのコンポーネントは自作したほうが良いことに察したので、
次回はボタンを自作してみようと思います。

0 件のコメント:

コメントを投稿