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

native-x-list

v1.3.1

Published

List component

Downloads

945

Readme

native-x-list

semantic-release

This component adds space between to other components

Install

Yarn

yarn add native-x-list

NPM

npm install native-x-list

Usage

import { List } from 'native-x-list'

const users: User[] = [{ id: '1', name: 'John Doe', userId: 'johnd' }]

// with just render function
function UserList() {
  return <List items={users}>{user => <User user={user} />}</List>
}

// with additional elements
function UserList() {
  return (
    <List items={users}>
      <UserListHeader />
      {user => <User user={user} />}
      <UserListFooter />
    </List>
  )
}

You can integrate list with a search box as shown below:

import { List } from 'native-x-list'
import { TextInput } from 'native-x-text-input'

function UserList() {
  const [searchText, setSearchText] = useState<string>()
  return (
    <List items={users} searchText={searchText}>
      <TextInput value={searchText} onChange={setSearchText} />
      {user => <User user={user} />}
    </List>
  )
}

API

| Property | Default Value | Usage | | ---------------------------------------------------------------- | ------------- | ------------------------------------------------------------------------------------------------------------------ | | children | | Array of JSX elements and a render function | | columnWrapperStyle?: ViewStyle | | Additional styles for column wrapper | | disabled?: boolean | | Disables all interactions if set to true | | divider?: boolean | | Show a divider if set to true | | emptyMessage?: { title: string, message: string} | | Show "title" and a "message" if list is empty or use a render function | | error?: string | | Error to show | | fill?: boolean | | Fill the container | | groupBy?: Function | | A function to return a value or name of the property as "string" to group by which will be used as section headers | | horizontal?: boolean | | Render list horizontally | | isRefreshing?: boolean | | Shows a "pull-to-refresh" animation when true | | items: S[] | | (mandatory) Array of items | | keyExtractor?: Function | | A function to return a value or name of the property as "string" to use as key | | loading?: boolean | | Shows spinner if set to true | | maintainVisibleContent?: boolean | | Maintain visible content if set to true | | numColumn?: number | | Number of columns for the list | | onFetchNext?: () => void | | A function to fetch next page when reaching end of the list (useful for paginated list) | | onRefresh?: () => void | | Event handler when user "pull-to-refresh" | | onScroll?: (e?: NativeSyntheticEvent) => void | | Event handler for scroll | | onScrollToTopChange?: () => void | | Event handler when the list is scrolled to the top of the list | | onSelectItem?: (props: { item: S, index?: number}) => void | | Event handler when an item is pressed | | renderSectionHeader?: (title: string) => ReactNode | | A function to render section header | | searchBy?: Function | | A function to return a value or name of the property as "string" to search by | | searchText?: string | | A string to use as search pattern | | separator?: ReactNode | | JSX element to render as separator between elements | | showScrollIndicator?: boolean | | Show scroll indicator if set to true | | stickySectionHeadersEnabled?: boolean | | Use sticky section headers | | style?: ViewStyle | | Additional styles for the list |

Automatic Release

Here is an example of the release type that will be done based on a commit messages:

| Commit message | Release type | | ------------------- | --------------------- | | fix: [comment] | Patch Release | | feat: [comment] | Minor Feature Release | | perf: [comment] | Major Feature Release | | doc: [comment] | No Release | | refactor: [comment] | No Release | | chore: [comment] | No Release |