{"id":16346814,"url":"https://github.com/cht8687/react-expandable-listview","last_synced_at":"2025-03-20T23:32:48.911Z","repository":{"id":66063190,"uuid":"46172623","full_name":"cht8687/react-expandable-listview","owner":"cht8687","description":"React expandable components, assist you render expandable objects or React components","archived":false,"fork":false,"pushed_at":"2017-08-27T03:22:36.000Z","size":638,"stargazers_count":37,"open_issues_count":4,"forks_count":10,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-17T18:53:51.418Z","etag":null,"topics":["css","listview","react","react-components"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cht8687.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-11-14T11:47:22.000Z","updated_at":"2023-05-26T11:19:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"a1c24322-c45f-40cc-8eec-ee948a3822b6","html_url":"https://github.com/cht8687/react-expandable-listview","commit_stats":{"total_commits":58,"total_committers":3,"mean_commits":"19.333333333333332","dds":"0.051724137931034475","last_synced_commit":"66ece091f80bc46e871f12c55cdd058938b17344"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cht8687%2Freact-expandable-listview","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cht8687%2Freact-expandable-listview/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cht8687%2Freact-expandable-listview/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cht8687%2Freact-expandable-listview/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cht8687","download_url":"https://codeload.github.com/cht8687/react-expandable-listview/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244520183,"owners_count":20465632,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["css","listview","react","react-components"],"created_at":"2024-10-11T00:37:35.461Z","updated_at":"2025-03-20T23:32:48.626Z","avatar_url":"https://github.com/cht8687.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# React expandable listview\n[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/cht8687/help)\n\n\u003cbig\u003e\u003ch1 align=\"center\"\u003eReact expandable listview\u003c/h1\u003e\u003c/big\u003e\n     \u003ch2 align=\"center\"\u003eRend components or plain object in an expandable way!\u003c/h2\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://circleci.com/gh/cht8687/react-expandable-listview\"\u003e\n    \u003cimg src=\"https://circleci.com/gh/cht8687/react-expandable-listview.svg?style=shield\"\n         alt=\"Circle CI\"\u003e\n  \u003c/a\u003e\n\n  \u003ca href=\"https://www.npmjs.com/package/react-expandable-listview\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/v/react-expandable-listview.svg?style=flat-square\"\n         alt=\"NPM Version\"\u003e\n  \u003c/a\u003e\n\n \u003ca href=\"https://coveralls.io/github/cht8687/react-expandable-listview?branch=master\"\u003e\n    \u003cimg src=\"https://coveralls.io/repos/cht8687/react-expandable-listview/badge.svg?branch=master\u0026service=github\" alt=\"Coverage Status\" /\u003e\n \u003c/a\u003e\n\n  \u003ca href=\"https://travis-ci.org/cht8687/react-expandable-listview\"\u003e\n    \u003cimg src=\"https://img.shields.io/travis/cht8687/react-expandable-listview.svg?style=flat-square\"\n         alt=\"Build Status\"\u003e\n  \u003c/a\u003e\n\n  \u003ca href=\"https://npmjs.org/package/react-expandable-listview\"\u003e\n    \u003cimg src=\"http://img.shields.io/npm/dm/react-expandable-listview.svg?style=flat-square\"\n         alt=\"Downloads\"\u003e\n  \u003c/a\u003e\n\n  \u003ca href=\"https://david-dm.org/cht8687/react-expandable-listview.svg\"\u003e\n    \u003cimg src=\"https://david-dm.org/cht8687/react-expandable-listview.svg?style=flat-square\"\n         alt=\"Dependency Status\"\u003e\n  \u003c/a\u003e\n\n  \u003ca href=\"https://github.com/cht8687/react-expandable-listview/blob/master/LICENSE\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/l/react-expandable-listview.svg?style=flat-square\"\n         alt=\"License\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\u003cbig\u003e\n\n\u003c/big\u003e\u003c/p\u003e\n\n![React expandable listview](src/example/react-expandable-listview.gif)\n\n\n## Philosophy\n\n\u003eYou don't need jQuery to do this...\n\n## Installation\n\n### npm\n\n```\n$ npm install --save react-expandable-listview\n```\n\n\n## Demo\n\n[http://cht8687.github.io/react-expandable-listview/example/](http://cht8687.github.io/react-expandable-listview/example/)\n\n## Example Code\n\n[https://github.com/cht8687/react-expandable-listview/tree/master/src/example](https://github.com/cht8687/react-expandable-listview/tree/master/src/example)\n\n## API\n\n#### \u0026lt;ReactExpandableListView /\u003e\n\n```js\n\u003cReactExpandableListView \n        data={data} \n        headerAttName=\"headerName\"\n        itemsAttName=\"items\" \n      /\u003e\n```\n\nThe component accepts three props.\n\n#### `data`: PropTypes.array.isRequired\n\n* note that `isReactComponent` is used to select if you want to render a react object or not.\n\n### Render plain object\n\n```js\nconst DATALIST = [\n{\n    headerName : \"ListG\",\n    isOpened: true,\n    isReactComponent: false,\n    items : [{\n      title : \"items1\"\n    }, {\n      title : \"items2\"\n    }, {\n      title : \"items3\"\n    },{\n      title : \"items4\"\n    },{\n      title : \"items5\"\n    },{\n      title : \"items6\"\n    }],\n    height: 100\n  },{\n    headerName : \"ListH\",\n    isOpened: true,\n    isReactComponent: false,\n    items : [{\n      title : \"items1\"\n    }, {\n      title : \"items2\"\n    }, {\n      title : \"items3\"\n    }],\n    height: 100\n  }\n];\n```\n\n### Render react component \n\nIf you want to render a react component, for example, a menu object, you can set `isReactComponent` to `true`:\n\n```js\nexport default class Menu extends React.Component {\n  static get menuItems() {\n    return [\n      {\n        headerName: 'Products',\n        isOpened: false,\n        height: 100,\n        isReactComponent: true,\n        items: [\n          (\n          \u003cLink\n            to=\"admin/products/all\"\n            className=\"btn btn-default\"\n            activeClassName=\"active\"\n          \u003e\n            All\n          \u003c/Link\u003e\n          ),\n          (\n          \u003cLink\n            to=\"admin/products/expired\"\n            className=\"btn btn-default\"\n            activeClassName=\"active\"\n          \u003e\n            Expired\n          \u003c/Link\u003e\n          ),\n          (\n          \u003cLink\n            to=\"admin/products/submitted\"\n            className=\"btn btn-default\"\n            activeClassName=\"active\"\n          \u003e\n            Submitted\n          \u003c/Link\u003e\n          ),\n        ],\n      },\n      {\n        headerName: 'Promotions',\n        isOpened: false,\n        height: 100,\n        isReactComponent: true,\n        items: [\n          (\n          \u003cLink\n            to=\"admin/promotions/active\"\n            className=\"btn btn-default\"\n            activeClassName=\"active\"\n          \u003e\n            Active\n          \u003c/Link\u003e\n          ),\n       ],\n      },\n      {\n        headerName: 'Settings',\n        isOpened: false,\n        height: 100,\n        isReactComponent: true,\n        items: [\n          (\n          \u003cLink\n            to=\"admin/settings/all\"\n            className=\"btn btn-default\"\n            activeClassName=\"active\"\n          \u003e\n            Al\n          \u003c/Link\u003e\n          ),\n        ],\n      },\n    ];\n  }\n\n  render() {\n    return (\n      \u003cdiv id=\"admin-menu\"\u003e\n        \u003cReactExpandableListView\n          data={this.constructor.menuItems}\n          headerAttName=\"headerName\"\n          itemsAttName=\"items\"\n        /\u003e\n      \u003c/div\u003e\n    );\n  }\n}\n\n```\n\n\nNote `height` varible defines the height you want each list to be like.\nYou can set different height data to suit the content of each section.\n\n#### `headerAttName`: PropTypes.string.isRequired\n\nVariable name of header in your `data` object.\nIn above example, it's `headerName`.\n\n#### `itemsAttName`: PropTypes.string.isRequired\n\nVariable name which hold items data in your `data` object.\nIn above example, it's `items`.\n\n\n## Styling\n\nThe CSS is flexible, commented and made to be easily customized.\n\nThere is an CSS file in the root level you can include it in your project.\n[CSS code](https://github.com/cht8687/react-expandable-listview/tree/master/react-expandable-listview.css).\n\n\n## Development\n\n```\n$ git clone https://github.com/cht8687/react-expandable-listview.git\n$ cd react-expandable-listview\n$ npm install\n$ webpack-dev-server\n```\n\nThen\n\n```\nopen http://localhost:8080/webpack-dev-server/\n```\n\n## License\n\nMIT\n\n[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcht8687%2Freact-expandable-listview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcht8687%2Freact-expandable-listview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcht8687%2Freact-expandable-listview/lists"}