All Projects → cht8687 → react-expandable-listview

cht8687 / react-expandable-listview

Licence: MIT license
React expandable components, assist you render expandable objects or React components

Programming Languages

javascript
184084 projects - #8 most used programming language
CSS
56736 projects

Projects that are alternatives of or similar to react-expandable-listview

React Virtualized
React components for efficiently rendering large lists and tabular data
Stars: ✭ 22,963 (+60328.95%)
Mutual labels:  listview, react-components
React Native Pagination
Animated Pagination For React Native's ListView, FlatList, and SectionList
Stars: ✭ 296 (+678.95%)
Mutual labels:  listview, react-components
Taurus
A little more fun for the pull-to-refresh interaction.
Stars: ✭ 1,674 (+4305.26%)
Mutual labels:  listview
Overscroll Decor
Android: iOS-like over-scrolling effect applicable over almost all scrollable Android views.
Stars: ✭ 2,671 (+6928.95%)
Mutual labels:  listview
Android Samples
Repository that contains android tutorial projects and sample applications
Stars: ✭ 209 (+450%)
Mutual labels:  listview
Advancedlist
Advanced List View for SwiftUI with pagination & different states
Stars: ✭ 165 (+334.21%)
Mutual labels:  listview
Swipeactionadapter
The Mailbox-like Swipe gesture library for Android
Stars: ✭ 217 (+471.05%)
Mutual labels:  listview
Swipemenulayout
🔥一个零耦合的侧滑菜单,支持RecyclerView、ListView、GridView等不同条目布局,支持菜单在左或在右,可选滑动阻塞,是否禁用等功能
Stars: ✭ 120 (+215.79%)
Mutual labels:  listview
yoast-components
Accessible React components by Yoast
Stars: ✭ 19 (-50%)
Mutual labels:  react-components
Flutter reorderable list
ReorderableList for Flutter
Stars: ✭ 208 (+447.37%)
Mutual labels:  listview
Admobadapter
It wraps your Adapter to display Admob native ads and banners in a ListView/RecyclerView data set. It based on the Yahoo fetchr project https://github.com/yahoo/fetchr
Stars: ✭ 224 (+489.47%)
Mutual labels:  listview
React Native Immutable List View
📜 Drop-in replacement for ListView, FlatList, and VirtualizedList.
Stars: ✭ 206 (+442.11%)
Mutual labels:  listview
React Native Cell Components
Awesome react-native cell components! From a Cell to more complex & awesome components.
Stars: ✭ 177 (+365.79%)
Mutual labels:  listview
Xamarin Demos
This repository contains the Syncfusion Xamarin UI control’s samples and the guide to use them.
Stars: ✭ 218 (+473.68%)
Mutual labels:  listview
Easyadapter
Android 轻量级适配器,简化使用,适应所有的AbsListView、RecyclerView。支持HeaderView与FooterView~
Stars: ✭ 160 (+321.05%)
Mutual labels:  listview
Jh flutter demo
a flutter demo
Stars: ✭ 229 (+502.63%)
Mutual labels:  listview
Kotlin Adapter
🔥 RecyclerView,AbsListView适配器, 支持多种视图样式, 支持吸顶、侧滑删除、拖拽效果
Stars: ✭ 132 (+247.37%)
Mutual labels:  listview
Smilerefresh
微笑下拉刷新。这是在 SwipeRefreshLayout基础上修改的下拉刷新库。
Stars: ✭ 203 (+434.21%)
Mutual labels:  listview
Infinite Scroll Unity
Infinite Scroll is a script extension that allows you to use ScrollRect control as an infinite spinner. It is fast, simple and mobile-friendly way to make lists with thousands of rows.
Stars: ✭ 209 (+450%)
Mutual labels:  listview
UnityDynamicScrollView
Dynamic scrollView based on UGUI
Stars: ✭ 161 (+323.68%)
Mutual labels:  listview

React expandable listview

Gitter

React expandable listview

Rend components or plain object in an expandable way!

Circle CI NPM Version Coverage Status Build Status Downloads Dependency Status License

React expandable listview

Philosophy

You don't need jQuery to do this...

Installation

npm

$ npm install --save react-expandable-listview

Demo

http://cht8687.github.io/react-expandable-listview/example/

Example Code

https://github.com/cht8687/react-expandable-listview/tree/master/src/example

API

<ReactExpandableListView />

<ReactExpandableListView 
        data={data} 
        headerAttName="headerName"
        itemsAttName="items" 
      />

The component accepts three props.

data: PropTypes.array.isRequired

  • note that isReactComponent is used to select if you want to render a react object or not.

Render plain object

const DATALIST = [
{
    headerName : "ListG",
    isOpened: true,
    isReactComponent: false,
    items : [{
      title : "items1"
    }, {
      title : "items2"
    }, {
      title : "items3"
    },{
      title : "items4"
    },{
      title : "items5"
    },{
      title : "items6"
    }],
    height: 100
  },{
    headerName : "ListH",
    isOpened: true,
    isReactComponent: false,
    items : [{
      title : "items1"
    }, {
      title : "items2"
    }, {
      title : "items3"
    }],
    height: 100
  }
];

Render react component

If you want to render a react component, for example, a menu object, you can set isReactComponent to true:

export default class Menu extends React.Component {
  static get menuItems() {
    return [
      {
        headerName: 'Products',
        isOpened: false,
        height: 100,
        isReactComponent: true,
        items: [
          (
          <Link
            to="admin/products/all"
            className="btn btn-default"
            activeClassName="active"
          >
            All
          </Link>
          ),
          (
          <Link
            to="admin/products/expired"
            className="btn btn-default"
            activeClassName="active"
          >
            Expired
          </Link>
          ),
          (
          <Link
            to="admin/products/submitted"
            className="btn btn-default"
            activeClassName="active"
          >
            Submitted
          </Link>
          ),
        ],
      },
      {
        headerName: 'Promotions',
        isOpened: false,
        height: 100,
        isReactComponent: true,
        items: [
          (
          <Link
            to="admin/promotions/active"
            className="btn btn-default"
            activeClassName="active"
          >
            Active
          </Link>
          ),
       ],
      },
      {
        headerName: 'Settings',
        isOpened: false,
        height: 100,
        isReactComponent: true,
        items: [
          (
          <Link
            to="admin/settings/all"
            className="btn btn-default"
            activeClassName="active"
          >
            Al
          </Link>
          ),
        ],
      },
    ];
  }

  render() {
    return (
      <div id="admin-menu">
        <ReactExpandableListView
          data={this.constructor.menuItems}
          headerAttName="headerName"
          itemsAttName="items"
        />
      </div>
    );
  }
}

Note height varible defines the height you want each list to be like. You can set different height data to suit the content of each section.

headerAttName: PropTypes.string.isRequired

Variable name of header in your data object. In above example, it's headerName.

itemsAttName: PropTypes.string.isRequired

Variable name which hold items data in your data object. In above example, it's items.

Styling

The CSS is flexible, commented and made to be easily customized.

There is an CSS file in the root level you can include it in your project. CSS code.

Development

$ git clone https://github.com/cht8687/react-expandable-listview.git
$ cd react-expandable-listview
$ npm install
$ webpack-dev-server

Then

open http://localhost:8080/webpack-dev-server/

License

MIT

js-standard-style

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].