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

@captain-omega/react-native-tree-view

v1.0.2

Published

React Native component for hierarchical data representation.

Downloads

13

Readme

react-native-tree-view

React Native component for hierarchical data representation. Has expandable row, which useful for displaying large amounts of information in vertical space.

Show Cases

demo.gif

Getting Started

Installation

Install main package:

$ npm i --save @captain-omega/react-native-tree-view

Install related icons package react-native-vector-icons:

$ npm i --save react-native-vector-icons

Add settings for your platform, see more here

IOS

react-native link react-native-vector-icons

Android

Edit android/app/build.gradle ( NOT android/build.gradle ) and add the following:

apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"

Basic Usage

  • Install @captain-omega/react-native-tree-view package to project

  • Import module to file

import TreeView from '@captain-omega/react-native-tree-view';
  • Then, use component like this:
<TreeView  
  cells={level1}
  data={data}  
  renderExpand={(item) => (
    <TreeView
      hideHeaders
      cells={level2}
      data={item.children}
      hideArrow
    />
  )}
/>

You can watch more examples in example directory

Properties

Basic props of TreeView

| Prop | Default | Type | Description | | :------------ |:---------------:| :---------------:| :-----| | cells | - | array | An array of objects that each describe a cell. See the cells property definition here. | | contentStyle | {} | style | See default style in source. | | data | - | array | The array of table rows. | | headerStyle | {} | style | See default style in source. | | hideArrow | false | bool | Hide column with arrows if this parameter is true. | | hideHeaders | false | bool | Hide component headers. | | isExpandable | null | function | Function that return true if row is expandable and false if it doesn't. | | open | false | bool | Open all expandable rows by default. | | onPress | null | function | Handle row press event. | | renderExpand | null | function | Render function for expandable content. If this parameter is null, then row not expandable. |

Cells definition

| Prop | Default | Type | Description | | :------------ |:---------------:| :---------------:| :-----| | cellStyle | {} | style | Set row cell style. | | headerCellStyle | {} | style | Set header cell style. | | renderHeaderCell | - | function | Render header cell content. | | renderRowCell | - | function | Render row cell content. | | width | 30 | number | Width of column. |

Run example

To run example call this commands in terminal:

$ cd example
$ npm i
$ react-native run-android
$ react-native run-ios

Notice!

If your npm not support symlinks, then call this code from repository root directory:

$ mkdir example/node_modules/@captain-omega
$ cp -alf $PWD example/node_modules/@captain-omega
$ rm -R example/node_modules/@captain-omega/react-native-tree-view/example
$ cd example
$ react-native run-android
$ react-native run-ios