{"id":20776797,"url":"https://github.com/avocode/react-listview","last_synced_at":"2025-04-30T18:09:55.029Z","repository":{"id":8577084,"uuid":"58890266","full_name":"avocode/react-listview","owner":"avocode","description":"Create List components with keyboard support","archived":false,"fork":false,"pushed_at":"2022-12-11T16:39:58.000Z","size":884,"stargazers_count":13,"open_issues_count":18,"forks_count":6,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-30T18:09:48.776Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"CoffeeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/avocode.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-05-15T23:39:29.000Z","updated_at":"2020-12-12T13:33:20.000Z","dependencies_parsed_at":"2023-01-13T15:01:14.727Z","dependency_job_id":null,"html_url":"https://github.com/avocode/react-listview","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avocode%2Freact-listview","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avocode%2Freact-listview/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avocode%2Freact-listview/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avocode%2Freact-listview/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/avocode","download_url":"https://codeload.github.com/avocode/react-listview/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251758170,"owners_count":21638989,"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":[],"created_at":"2024-11-17T13:11:54.373Z","updated_at":"2025-04-30T18:09:54.999Z","avatar_url":"https://github.com/avocode.png","language":"CoffeeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# React ListView\n\n**Create List components with keyboard support**\n\n![Build Status](https://travis-ci.org/avocode/react-listview.svg?branch=master)\n\n## Usage\n\n```\nnpm i react-listview-keys --save\n```\n\n## Example\n\n![React ListView example](https://s3.amazonaws.com/f.cl.ly/items/322J3v0u1n2l39153327/example.gif?v=fe99b357)\n\n```coffee\nListView = require 'react-listview'\n\nListView\n  className: 'list-view'\n  itemClassName: 'list-view__item'\n  selectedItemClassName: 'list-view__item--selected'\n  items: @state.listItems\n  selectedItemId: @state.selectedListItemId\n  collapsedItemIds: @state.collapsedListItemIds\n  onCollapseItem: @_handleCollapseListItem\n  onExpandItem: @_handleExpandListItem\n  onSelectItem: @_handleSelectListItem\n  renderItem: (itemId, parentItemIds = []) =\u003e\n    item = @_getItemById(itemId)\n    if parentItemIds.length == 0\n      if item.children?.size \u003e 0\n        SimpleListItem\n          item: item\n      else\n        FoldableListItem\n          item: item\n    else\n      SimpleListSubItem\n        item: item\n```\n\n\n### Props\n\n- `className` - CSS class of the whole ListView component\n- `itemClassName` - CSS class of non-selected ListItem\n- `selectedItemClassName` - CSS class of selected ListItem\n\n- `items` - immutable.List of items to render\n\n- `selectedItemId` - `id` of selected items\n- `collapsedItemIds` - immutable.List of `id`s of collapsed parent items\n\n- `onCollapseItem` - callback called when collapsing a parent item\n- `onExpandItem` - callback called when expanding a parent item\n- `onSelectItem` - callback called after click on an item\n- `renderItem` - function that renders the item (passed as callback so  apps can handle the rendering of the main content itself)\n\n\n## Development\n\n```\ngit clone git@github.com:avocode/react-listview.git\ncd react-listview\n\nnpm install\n```\n\n\nRun tests:\n\n```\nnpm test\n```\n\n### TODOs\n- refactor logic - support deeper lists\n- add shouldcomponentupdates\n- improve tests\n- rethink tabIndices\n- add more examples\n- add prop for last item skipping\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favocode%2Freact-listview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Favocode%2Freact-listview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favocode%2Freact-listview/lists"}