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

rnlist

v0.0.12

Published

react native list

Downloads

13

Readme

RNList

基础列表模板

使用

import RNList from 'rnlist'

// 与 FlatList 使用
<FlatList
    data={list}
    renderItem={({item, index}) => 
        <RNList data={item} style={listStyle}/>
    }
    keyExtractor={(item, index) => index}
>
</FlatList>

// 列表自定义样式
const listStyle = StyleSheet.create({
	list: {
		height: 52,
	},
    // 文字主体
    txtBox: {
        flex: 1,
    },
    // 标题
    title: {
        fontSize: 14,
		color: '#666',
		fontWeight: 'normal'
	},
	// 附件信息
	accessoryBox: {
		flex: 3,
	},
	// 文字附件
	accessoryTxt: {
		fontSize: 14,
		color: '#333'
	}	
})

样式参数

| 参数 | 类型 | 说明 | | --- | --- | --- | | data | Object | 显示内容 | | style | Style | 自定义样式 | | that | Object | 原对象 this | | callback | Function | 自定义函数,返回 this |

data 参数内容

| 参数 | 类型 | 说明 | | --- | --- | --- | |icon | String | 图标 | |title | String |标题 | |subTitle | String |副标题 | |preview | String |预览信息 | |accessory | Object |附件信息 | |separator | List |箭头 |

preview 预览

| 参数 | 类型 | 说明 | | --- | --- | --- | | line | Number | 用于规定显示的行数 | | inner | String | 显示的内容 |

accessory 附件

| 参数 | 类型 | 说明 | | --- | --- | --- | | type | List | 用于规定显示的类型,可选 ['text','img','Image']| | inner | String | 显示的内容 |

type: "Image" 的图片引用为 inner: require('./img/yourImg.png')

separator 箭头

| 参数 | 类型 | 说明 | | --- | --- | --- | | up | String | 显示向上的箭头 | | down | String | 显示向下的箭头 | | left | String | 显示向左的箭头 | | right | String | 显示向右的箭头 |

Style 自定义样式

| 参数 | 说明 | | --- | --- | |list | 盒子 | |line | 下划线 | |body | 主体 | |iconBox | 图标盒子 | |icon | 图标 | |txtBox | 文字主体 | |title |标题 | |subTitle |副标题 | |preview |预览信息 | |accessoryBox |附件信息 | |accessoryImg |图片附件 | |accessoryTxt |文字附件 |

具体可以查看 index.js 的样式部分