npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

kenote-react-native-design

v2.0.0-alpha.2

Published

React Native components...

Downloads

41

Readme

kenote-react-native-design

一个关于 React Native 的 UI组件库,基于 react 15.4.x 和 react-native 0.42.x

NPM Version NPM Downloads dependencies Status Gratipay

相关依赖

  • react-native-spinkit
  • react-native-vector-icons

安装

npm

npm i --save kenote-react-native-design

yarn

yarn add kenote-react-native-design

Button

使用

import { Button } from 'kenote-react-native-design'

方式一

<Button
  style={{ backgroundColor: '#666666' }}
  label={'按钮'}
  labelStyle={{ fontSize: 18, color: '#ffffff' }}
  icon={'home'}
  iconColor={'#ffffff'}
  iconSize={20}
  disabled
  disabledStyle={{ backgroundColor: '#999999' }}
  onPress={() => console.log('点击事件')}
  />

方式二

<Button
  style={{ backgroundColor: '#666666' }}
  disabled
  disabledStyle={{ backgroundColor: '#999999' }}
  onPress={() => console.log('点击事件')}>
  <View style={{ alignItems: 'center', justifyContent: 'center', flexDirection: 'row' }}>
    <Icon name={'home'} size={20} color={'#ffffff'} />
    <Text style={{ fontSize: 18, color: '#ffffff' }}>
      按钮
    </Text>
  </View>
 </Button>

Props

| Property | Type | Default | Description | |----------|------|---------|-------------| | style | <Object> | null | 外观样式,高度默认为 50 | | label | <String> | undefined | 按钮文字 | | labelStyle | <Object> | null | 按钮文字样式 | | icon | <String> | undefined | 图标名称,图标使用了 FontAwesome,具体名称可到官网查询。| | iconColor | <String> | '#fff' | 图标颜色 | | iconSize | <Number> | 20 | 图标大小 | | disabled | <Bool> | false | 按钮禁用状态 | | disabledStyle | <Object> | null | 按钮禁用样式 | | onPress | <Function> | () => null | 按钮点击事件 | | children | <React.element> | undefined | 按钮内嵌子元素 |

LeftButton

使用

import { LeftButton } from 'kenote-react-native-design'

<LeftButton
  style={{ backgroundColor: '#666666' }}
  label={'后退'}
  color={'#ffffff'}
  onPress={() => console.log('后退')}
  />

Props

| Property | Type | Default | Description | |----------|------|---------|-------------| | style | <Object> | null | 外观样式 | | label | <String> | undefined | 按钮文字 | | color | <String> | undefined | 按钮文字颜色 | | onPress | <Function> | () => null | 按钮点击事件 |

RightButton

使用

import { RightButton } from 'kenote-react-native-design'

<RightButton
  style={{ backgroundColor: '#666666' }}
  label={'前进'}
  color={'#ffffff'}
  onPress={() => console.log('前进')}
  />

Props

| Property | Type | Default | Description | |----------|------|---------|-------------| | style | <Object> | null | 外观样式 | | label | <String> | undefined | 按钮文字 | | color | <String> | undefined | 按钮文字颜色 | | onPress | <Function> | () => null | 按钮点击事件 |

Form

使用

import { Form } 'kenote-react-native-design'

const options = [
  {
    type: 'forminput',
    name: 'username',
    label: '用户名',
    labelIcon: 'user',
    labelColor: '#8cc3b2',
    placeholder: '用户名/邮箱',
    returnKeyType: 'next',
    isRequired: true
  },
  {
    type: 'forminput',
    name: 'password',
    label: '密  码',
    labelIcon: 'lock',
    labelColor: '#8cc3b2',
    placeholder: '密码',
    password: true,
    returnKeyType: 'default',
    isRequired: true
  }
]

<Form
  ref={'formlogin'}
  options={options}
  buttonLabel={'登 录'}
  buttonPress={ e => console.log(e) } />
// e = { username: '', password: '' }

Options Element

{
  type              : 'forminput',  // 单元类型,目前只支持 'forminput'
  name              : 'username',   // 单元名称
  label             : '用户名',      // 单元标签
  labelIcon         : 'user',       // 单元标签图标;如果启用,label则失效
  labelColor        : '#8cc3b2',    // 单元标签颜色
  placeholder       : '密码',        // 单元描述文字
  placeholderColor  : '#ccc',       // 单元描述文字颜色
  password          : true,         // 是否是密码类型
  keyboardType      : 'default',    // 手机键盘类型; 'default'|'numeric'|'email-address'|'ascii-capable'|'numbers-and-punctuation'|'url'|'number-pad'|'phone-pad'|'name-phone-pad'|'decimal-pad'|'twitter'|'web-search'
  returnKeyType     : 'default',    // 手机键盘`return`键类型; 'default'|'go'|'google'|'join'|'next'|'route'|'search'|'send'|'yahoo'|'done'|'emergency-call'
  isRequired        : true          // 是否必填项
}

Props

| Property | Type | Default | Description | |----------|------|---------|-------------| | style | <Object> | null | 外观样式 | | options | <Collection> | [] | 表单结构数据 | | buttonLabel | <String> | 'Submit' | 提交按钮文字名称 | | buttonPress | <Function> | () => null | 提交表单事件 | | buttonDisabledStyle | <Object> | null | 提交按钮禁用状态样式 | | pending | <Bool> | false | 表单提交状态,提交中<true> | 提交完成<false> | | marginWidth | <Number> | 15 | 表单左右两侧边距 | | textInputStyle | <Object> | null | 表单内文本框样式 |